From 440f24271c39e3561976e69e62440b7e80724ba1 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Tue, 21 Jan 2025 16:01:23 -0600 Subject: [PATCH] sparkle motion mini example --- .../code.py | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Sparkle_Motion_Mini_Examples/CircuitPython_Sparkle_Motion_Mini_Neopixel_Animation/code.py diff --git a/Sparkle_Motion_Mini_Examples/CircuitPython_Sparkle_Motion_Mini_Neopixel_Animation/code.py b/Sparkle_Motion_Mini_Examples/CircuitPython_Sparkle_Motion_Mini_Neopixel_Animation/code.py new file mode 100644 index 000000000..1989c9bf5 --- /dev/null +++ b/Sparkle_Motion_Mini_Examples/CircuitPython_Sparkle_Motion_Mini_Neopixel_Animation/code.py @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: 2025 Tim Cocks for Adafruit Industries +# +# SPDX-License-Identifier: MIT +""" +Example illustrating two different LED Animations running on +Neopixels connected to the 2 main outputs of the Sparkle Motion Mini +""" +import board +import neopixel + +from adafruit_led_animation.animation.comet import Comet +from adafruit_led_animation.animation.rainbow import Rainbow +from adafruit_led_animation.color import GREEN + +strip1_pixel_pin = board.D33 +strip2_pixel_pin = board.D32 + +pixel_count = 8 + +strip1_pixels = neopixel.NeoPixel( + strip1_pixel_pin, pixel_count, brightness=0.1, auto_write=False +) +strip2_pixels = neopixel.NeoPixel( + strip2_pixel_pin, pixel_count, brightness=0.05, auto_write=False +) + +comet = Comet(strip1_pixels, speed=0.05, color=GREEN, tail_length=3, bounce=True) +rainbow = Rainbow(strip2_pixels, speed=0.05, period=3) + +while True: + comet.animate() + rainbow.animate()