Skip to content

Commit 5bf2274

Browse files
authored
Merge pull request #1922 from adafruit/neopixel_rings_lamp
neopixel ring lamp code
2 parents f878fdd + d9994aa commit 5bf2274

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

NeoPixel_Rings_Lamp/code.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# SPDX-FileCopyrightText: 2021 Ruiz Brothers for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
4+
import board
5+
import neopixel
6+
from adafruit_led_animation.animation.pulse import Pulse
7+
from adafruit_led_animation.animation.rainbow import Rainbow
8+
from adafruit_led_animation.animation.rainbowsparkle import RainbowSparkle
9+
from adafruit_led_animation.animation.rainbowcomet import RainbowComet
10+
from adafruit_led_animation.sequence import AnimationSequence
11+
from adafruit_led_animation.color import PURPLE
12+
13+
# Update this to match the number of NeoPixel LEDs connected to your board.
14+
num_pixels = 124
15+
16+
pixels = neopixel.NeoPixel(board.GP1, num_pixels, auto_write=True)
17+
pixels.brightness = 0.2
18+
19+
rainbow = Rainbow(pixels, speed=0.01, period=1)
20+
rainbow_sparkle = RainbowSparkle(pixels, speed=0.05, num_sparkles=15)
21+
rainbow_comet = RainbowComet(pixels, speed=.01, tail_length=20, bounce=True)
22+
pulse = Pulse(pixels, speed=.05, color=PURPLE, period=3)
23+
24+
animations = AnimationSequence(
25+
pulse,
26+
rainbow_sparkle,
27+
rainbow_comet,
28+
rainbow,
29+
advance_interval=5,
30+
auto_clear=True,
31+
random_order=False
32+
)
33+
34+
while True:
35+
animations.animate()

0 commit comments

Comments
 (0)