|
1 | 1 | """
|
2 |
| -Example animation sequence. |
| 2 | +This example repeatedly displays two animations, Comet and Chase, at a five second interval. |
| 3 | +
|
| 4 | +Designed for NeoPixel FeatherWing. Update pixel_pin and pixel_num to match your wiring if using |
| 5 | +a different form of NeoPixels. |
3 | 6 | """
|
4 | 7 | import board
|
5 | 8 | import neopixel
|
6 |
| -from adafruit_led_animation.animation import Comet, AnimationSequence, Chase |
| 9 | +from adafruit_led_animation.animation import Comet, Chase |
| 10 | +from adafruit_led_animation.helper import AnimationSequence |
7 | 11 | from adafruit_led_animation.color import PURPLE, WHITE
|
8 | 12 |
|
9 |
| -pixels = neopixel.NeoPixel(board.D6, 32, brightness=0.2, auto_write=False) |
| 13 | +# Update to match the pin connected to your NeoPixels |
| 14 | +pixel_pin = board.D6 |
| 15 | +# Update to match the number of NeoPixels you have connected |
| 16 | +pixel_num = 32 |
| 17 | + |
| 18 | +pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.2, auto_write=False) |
| 19 | + |
10 | 20 | comet = Comet(pixels, speed=0.01, color=PURPLE, tail_length=10, bounce=True)
|
11 | 21 | chase = Chase(pixels, speed=0.1, size=3, spacing=6, color=WHITE)
|
12 |
| -animations = AnimationSequence(comet, chase, advance_interval=15) |
| 22 | + |
| 23 | +animations = AnimationSequence(comet, chase, advance_interval=5) |
13 | 24 |
|
14 | 25 | while True:
|
15 | 26 | animations.animate()
|
0 commit comments