Skip to content

Commit 32b326a

Browse files
authored
Merge pull request #1951 from adafruit/qtpy_acrylic_lamp
code for qt py acrylic lamp
2 parents 86834b9 + 765ba45 commit 32b326a

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

QT_Py_Acrylic_Lamp/code.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# SPDX-FileCopyrightText: 2021 Ruiz Bros for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
4+
"""
5+
This example displays three chase animations in sequence.
6+
"""
7+
import board
8+
import neopixel
9+
from adafruit_led_animation.animation.chase import Chase
10+
from adafruit_led_animation.sequence import AnimationSequence
11+
from adafruit_led_animation.color import (
12+
RED,
13+
GREEN,
14+
BLUE
15+
)
16+
17+
# Update to match the pin connected to your NeoPixels
18+
pixel_pin = board.D0
19+
# Update to match the number of NeoPixels you have connected
20+
pixel_num = 8
21+
22+
pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.8, auto_write=False)
23+
24+
RedChase = Chase(pixels, speed=0.4, color=RED, size=1, spacing=8, reverse=True)
25+
GreenChase = Chase(pixels, speed=0.4, color=GREEN, size=1, spacing=8, reverse=True)
26+
BlueChase = Chase(pixels, speed=0.4, color=BLUE, size=1, spacing=8, reverse=True)
27+
28+
animations = AnimationSequence(
29+
RedChase,
30+
GreenChase,
31+
BlueChase,
32+
advance_interval=4,
33+
auto_clear=True,
34+
)
35+
36+
while True:
37+
animations.animate()

0 commit comments

Comments
 (0)