Skip to content

code for NeoPixel Menorah #1927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions NeoPixel_Menorah/code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2021 Noe Ruiz for Adafruit Industries
# SPDX-License-Identifier: MIT

"""
NeoPixel Menorah using QT Py RP2040.
"""
import board
import neopixel
from adafruit_led_animation.animation.pulse import Pulse
from adafruit_led_animation.animation.solid import Solid
from adafruit_led_animation.animation.sparkle import Sparkle
from adafruit_led_animation.animation.chase import Chase
from adafruit_led_animation.sequence import AnimationSequence
from adafruit_led_animation.color import AMBER

# Update to match the pin connected to your NeoPixels
pixel_pin = board.D0
# Update to match the number of NeoPixels you have connected
pixel_num = 9

pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=1, auto_write=False)

solid = Solid(pixels, color=AMBER)
pulse = Pulse(pixels, speed=0.05, color=AMBER, period=5)
sparkle = Sparkle(pixels, speed=0.15, color=AMBER, num_sparkles=10)
chase = Chase(pixels, speed=0.1, color=AMBER, size=1, spacing=8)

animations = AnimationSequence(
chase,
pulse,
sparkle,
solid,
advance_interval=5,
auto_clear=True,
)

while True:
animations.animate()