Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import board
- import neopixel
- import time
- from adafruit_led_animation.animation.blink import Blink
- from adafruit_led_animation.animation.comet import Comet
- from adafruit_led_animation.animation.chase import Chase
- from adafruit_led_animation.animation.pulse import Pulse
- from adafruit_led_animation.sequence import AnimationSequence
- from adafruit_led_animation.color import PURPLE, AMBER, JADE, CYAN, TEAL
- from adafruit_led_animation.group import AnimationGroup
- from adafruit_led_animation import color
- from adafruit_led_animation.animation.sparkle import Sparkle
- from adafruit_led_animation import helper
- from adafruit_led_animation.helper import PixelMap
- # 206 Neopixels(103 on 2 different pins)
- pixel_pin = board.A4
- pixel_pinL = board.A2
- # Update to match the number of NeoPixels you have connected
- pixel_num = 144
- pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.5, auto_write=False, pixel_order=(1, 0, 2, 3))
- pixil = neopixel.NeoPixel(pixel_pinL, pixel_num, brightness=0.5, auto_write=False, pixel_order=(1, 0, 2, 3))
- leds_range0 = PixelMap(pixels, range(0,16), individual_pixels=True) #0 to J-shape
- leds_range1 = PixelMap(pixil, range(0,17), individual_pixels=True)
- leds_sidecresL1 = PixelMap(pixil, range(17,23), individual_pixels=True)
- leds_sidecresR1 = PixelMap(pixels, range(17,22), individual_pixels=True)
- leds_sidecresL2 = PixelMap(pixil, range(24,29), individual_pixels=True)
- leds_sidecresR2 = PixelMap(pixels, range(23,29), individual_pixels=True)
- leds_R_0 = PixelMap(pixil, range(70,85), individual_pixels=True)
- leds_R_1 = PixelMap(pixels, range(2,10), individual_pixels=True)
- leds_stemL1 = PixelMap(pixil, [30, 31, 32, 33, 34, 35], individual_pixels=True) #18 to 23 crescent right (1)
- leds_stemL2 = PixelMap(pixil, range(56,70), individual_pixels=True) #24 to 29 crescent right (2)
- #leds_stemL3 = PixelMap(pixil, range(45,85), individual_pixels=True) #18 to 22 crescent left (1)
- #leds_stemR1 = PixelMap(pixels, range(30,37), individual_pixels=True) #23 to 27 crescent left (2)
- #leds_stemR2 = PixelMap(pixels, range(38,44), individual_pixels=True)
- #leds_stemR3 = PixelMap(pixels, range(45,65), individual_pixels=True)
- animations = AnimationSequence(
- AnimationGroup(
- Comet(leds_range0, speed=0.04, tail_length=15, color=TEAL),
- Comet(leds_range1, speed=0.04, tail_length=15, color=TEAL),
- Comet(leds_sidecresL1, speed=0.04, tail_length=10, color=TEAL, reverse=True),
- Comet(leds_sidecresR1, speed=0.04, tail_length=10, color=TEAL, reverse=True),
- Comet(leds_sidecresL2, speed=0.04, tail_length=10, color=TEAL),
- Comet(leds_sidecresR2, speed=0.04, tail_length=10, color=TEAL, reverse=True),
- Comet(leds_stemL1, speed=0.04, tail_length=10, color=TEAL),
- Comet(leds_stemL2, speed=0.04, tail_length=10, color=TEAL),
- #After this point code completely stops responding, even passing higher up digits in the strip to a new line
- #the code is not being passed on and nothing lights up.
- #Comet(leds_R_0, speed=0.04, tail_length=2, color=TEAL),
- #Comet(leds_R_1, speed=0.04, tail_length=2, color=TEAL),
- #Comet(leds_stemL3, speed=0.04, tail_length=10, color=TEAL),
- #Comet(leds_stemR1, speed=0.04, tail_length=10, color=TEAL),
- #Comet(leds_stemR2, speed=0.04, tail_length=10, color=TEAL),
- #Comet(leds_stemR3, speed=0.04, tail_length=10, color=TEAL),
- #sync=True,
- ),
- AnimationGroup(
- Comet(pixels, speed=0.08, color=CYAN),
- Comet(pixil, speed=0.08, color=CYAN),
- #sync=True,
- Sparkle(pixels, speed=0.08, color=TEAL, num_sparkles=10),
- Sparkle(pixil, speed=0.08, color=CYAN, num_sparkles=10)
- ),
- advance_interval=8.0,
- auto_clear=True,
- auto_reset=True,
- )
- while True:
- animations.animate()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement