Skip to content

Commit b477820

Browse files
authored
Merge pull request #2950 from FoamyGuy/sparklemotionmini_examples
sparkle motion mini example
2 parents 09a8923 + 440f242 commit b477820

File tree

1 file changed

+32
-0
lines changed
  • Sparkle_Motion_Mini_Examples/CircuitPython_Sparkle_Motion_Mini_Neopixel_Animation

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SPDX-FileCopyrightText: 2025 Tim Cocks for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
"""
5+
Example illustrating two different LED Animations running on
6+
Neopixels connected to the 2 main outputs of the Sparkle Motion Mini
7+
"""
8+
import board
9+
import neopixel
10+
11+
from adafruit_led_animation.animation.comet import Comet
12+
from adafruit_led_animation.animation.rainbow import Rainbow
13+
from adafruit_led_animation.color import GREEN
14+
15+
strip1_pixel_pin = board.D33
16+
strip2_pixel_pin = board.D32
17+
18+
pixel_count = 8
19+
20+
strip1_pixels = neopixel.NeoPixel(
21+
strip1_pixel_pin, pixel_count, brightness=0.1, auto_write=False
22+
)
23+
strip2_pixels = neopixel.NeoPixel(
24+
strip2_pixel_pin, pixel_count, brightness=0.05, auto_write=False
25+
)
26+
27+
comet = Comet(strip1_pixels, speed=0.05, color=GREEN, tail_length=3, bounce=True)
28+
rainbow = Rainbow(strip2_pixels, speed=0.05, period=3)
29+
30+
while True:
31+
comet.animate()
32+
rainbow.animate()

0 commit comments

Comments
 (0)