|
| 1 | +# SPDX-FileCopyrightText: 2022 Noe Ruiz for Adafruit Industries |
| 2 | +# SPDX-License-Identifier: MIT |
| 3 | +# Werewolf and Moon Neon Sign |
| 4 | +import board |
| 5 | +import neopixel |
| 6 | +from adafruit_led_animation.animation.blink import Blink |
| 7 | +from adafruit_led_animation.animation.comet import Comet |
| 8 | +from adafruit_led_animation.animation.pulse import Pulse |
| 9 | +from adafruit_led_animation.group import AnimationGroup |
| 10 | +from adafruit_led_animation.sequence import AnimationSequence |
| 11 | +from adafruit_led_animation import color |
| 12 | + |
| 13 | +moon_leds = neopixel.NeoPixel(board.SDA, 60, brightness=0.8, auto_write=False, pixel_order=neopixel.RGB) |
| 14 | +wolf_leds = neopixel.NeoPixel(board.SCL, 57, brightness=0.8, auto_write=False, pixel_order=neopixel.RGB) |
| 15 | + |
| 16 | +animations = AnimationSequence( |
| 17 | + Blink(wolf_leds, speed=0.07, color=color.BLUE), |
| 18 | + Pulse(wolf_leds, speed=0.01, color=color.PURPLE, period=3), |
| 19 | + AnimationGroup( |
| 20 | + Pulse(wolf_leds, speed=0.01, color=color.PURPLE, period=3), |
| 21 | + Comet(moon_leds, speed=0.01, color=color.AMBER, tail_length=60, reverse=True), |
| 22 | + sync=True, |
| 23 | + ), |
| 24 | + AnimationGroup( |
| 25 | + Pulse(wolf_leds, speed=0.01, color=color.PURPLE, period=3), |
| 26 | + Pulse(moon_leds, speed=0.01, color=color.AMBER, period=3), |
| 27 | + sync=True, |
| 28 | + ), |
| 29 | + AnimationGroup( |
| 30 | + Pulse(wolf_leds, speed=0.01, color=color.PURPLE, period=3), |
| 31 | + Pulse(moon_leds, speed=0.01, color=color.AMBER, period=3), |
| 32 | + sync=True, |
| 33 | + ), |
| 34 | + advance_interval=2.0, |
| 35 | + auto_clear=True, |
| 36 | + auto_reset=True, |
| 37 | +) |
| 38 | + |
| 39 | +while True: |
| 40 | + animations.animate() |
0 commit comments