Skip to content

Commit 210fa1d

Browse files
committed
Finalise example updates and bugfixes.
1 parent 0f9ae69 commit 210fa1d

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

adafruit_led_animation/sequence.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ def __init__(
103103
name=None
104104
):
105105
if advance_interval and advance_on_cycle_complete:
106-
raise ValueError("Cannot use both advance_interval and advance_on_cycle_complete.")
106+
raise ValueError(
107+
"Cannot use both advance_interval and advance_on_cycle_complete."
108+
)
107109
self._members = members
108110
self._advance_interval = (
109111
advance_interval * NANOS_PER_SECOND if advance_interval else None

examples/led_animation_basic_animations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.2, auto_write=False)
3636

3737
solid = Solid(pixels, color=PINK)
38-
colorcycle = ColorCycle(pixels, speed=0.4, colors=[MAGENTA, ORANGE, TEAL])
3938
blink = Blink(pixels, speed=0.5, color=JADE)
40-
comet = Comet(pixels, speed=0.01, color=PURPLE, tail_length=10, bounce=True)
39+
colorcycle = ColorCycle(pixels, speed=0.4, colors=[MAGENTA, ORANGE, TEAL])
4140
chase = Chase(pixels, speed=0.1, color=WHITE, size=3, spacing=6)
41+
comet = Comet(pixels, speed=0.01, color=PURPLE, tail_length=10, bounce=True)
4242
pulse = Pulse(pixels, speed=0.1, color=AMBER, period=3)
4343

4444

4545
animations = AnimationSequence(
46-
solid, comet, blink, chase, colorcycle, pulse, advance_interval=5, auto_clear=True,
46+
solid, blink, colorcycle, chase, comet, pulse, advance_interval=5, auto_clear=True,
4747
)
4848

4949
while True:

examples/led_animation_pixel_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
comet_v = Comet(pixel_wing_vertical, speed=0.1, color=AMBER, tail_length=6, bounce=True)
4141
chase_h = Chase(pixel_wing_horizontal, speed=0.1, size=3, spacing=6, color=JADE)
4242
rainbow_chase_v = RainbowChase(
43-
pixel_wing_vertical, speed=0.1, size=3, spacing=2, wheel_step=8
43+
pixel_wing_vertical, speed=0.1, size=3, spacing=2, step=8
4444
)
4545
rainbow_comet_v = RainbowComet(
4646
pixel_wing_vertical, speed=0.1, tail_length=7, bounce=True

examples/led_animation_sequence.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,14 @@
1919
# Update to match the number of NeoPixels you have connected
2020
pixel_num = 32
2121

22-
pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.2, auto_write=False)
22+
pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.1, auto_write=False)
2323

2424
blink = Blink(pixels, speed=0.5, color=JADE)
2525
comet = Comet(pixels, speed=0.01, color=PURPLE, tail_length=10, bounce=True)
2626
chase = Chase(pixels, speed=0.1, size=3, spacing=6, color=AMBER)
2727

2828

29-
animations = AnimationSequence(
30-
comet, blink, chase, advance_interval=5, auto_clear=True, random_order=True,
31-
)
29+
animations = AnimationSequence(blink, comet, chase, advance_interval=3, auto_clear=True)
3230

3331
while True:
3432
animations.animate()

0 commit comments

Comments
 (0)