Skip to content

Commit 5bd6bfe

Browse files
committed
Update simpletest to new API.
1 parent ab085fd commit 5bd6bfe

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

examples/led_animation_simpletest.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
"""
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.
36
"""
47
import board
58
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
711
from adafruit_led_animation.color import PURPLE, WHITE
812

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+
1020
comet = Comet(pixels, speed=0.01, color=PURPLE, tail_length=10, bounce=True)
1121
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)
1324

1425
while True:
1526
animations.animate()

0 commit comments

Comments
 (0)