Skip to content

Fix doc example to match updated API. #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions adafruit_led_animation/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,19 @@ class AnimationSequence:

import board
import neopixel
from adafruit_led_animation.animation import AnimationSequence, Blink, Comet, Sparkle
from adafruit_led_animation.sequence import AnimationSequence
import adafruit_led_animation.animation.comet as comet_animation
import adafruit_led_animation.animation.sparkle as sparkle_animation
import adafruit_led_animation.animation.blink as blink_animation
import adafruit_led_animation.color as color

strip_pixels = neopixel.NeoPixel(board.A1, 30, brightness=1, auto_write=False)

blink = Blink(strip_pixels, 0.2, color.RED)
comet = Comet(strip_pixels, 0.1, color.BLUE)
sparkle = Sparkle(strip_pixels, 0.05, color.GREEN)
blink = blink_animation.Blink(strip_pixels, 0.2, color.RED)
comet = comet_animation.Comet(strip_pixels, 0.1, color.BLUE)
sparkle = sparkle_animation.Sparkle(strip_pixels, 0.05, color.GREEN)

animations = AnimationSequence(blink, comet, sparkle, advance_interval=1)
animations = AnimationSequence(blink, comet, sparkle, advance_interval=5)

while True:
animations.animate()
Expand Down