|
11 | 11 |
|
12 | 12 | from adafruit_led_animation.animation.customcolorchase import CustomColorChase
|
13 | 13 | from adafruit_led_animation.sequence import AnimationSequence
|
| 14 | + |
14 | 15 | # colorwheel only needed for rainbowchase example
|
15 | 16 | from adafruit_led_animation.color import colorwheel
|
| 17 | + |
16 | 18 | # Colors for customcolorchase examples
|
17 | 19 | from adafruit_led_animation.color import PINK, GREEN, RED, BLUE
|
18 | 20 |
|
|
28 | 30 |
|
29 | 31 | # colors default to RAINBOW as defined in color.py
|
30 | 32 | custom_color_chase_rainbow = CustomColorChase(pixels, speed=0.1, size=2, spacing=3)
|
31 |
| -custom_color_chase_rainbow_r = CustomColorChase(pixels, speed=0.1, size=3, spacing=3,reverse=True) |
| 33 | +custom_color_chase_rainbow_r = CustomColorChase( |
| 34 | + pixels, speed=0.1, size=3, spacing=3, reverse=True |
| 35 | +) |
32 | 36 |
|
33 | 37 | # Example with same colors as RainbowChase
|
34 |
| -steps=30 |
35 |
| -#This was taken from rainbowchase.py |
| 38 | +steps = 30 |
| 39 | +# This was taken from rainbowchase.py |
36 | 40 | rainbow_colors = [colorwheel(n % 256) for n in range(0, 512, steps)]
|
37 |
| -#Now use rainbow_colors with CustomColorChase |
38 |
| -custom_color_chase_rainbowchase = CustomColorChase(pixels, speed=0.1, colors=rainbow_colors, size=2, spacing=3) |
| 41 | +# Now use rainbow_colors with CustomColorChase |
| 42 | +custom_color_chase_rainbowchase = CustomColorChase( |
| 43 | + pixels, speed=0.1, colors=rainbow_colors, size=2, spacing=3 |
| 44 | +) |
39 | 45 |
|
40 | 46 | custom_color_chase_bgp = CustomColorChase(
|
41 | 47 | pixels, speed=0.1, colors=[BLUE, GREEN, PINK], size=3, spacing=2
|
42 | 48 | )
|
43 | 49 |
|
44 | 50 | # Can use integer values for color, 0 is black
|
45 | 51 | custom_color_chase_br = CustomColorChase(
|
46 |
| - pixels, speed=0.1, colors=[BLUE, 0, RED, 0], size=2, spacing=0 ) |
| 52 | + pixels, speed=0.1, colors=[BLUE, 0, RED, 0], size=2, spacing=0 |
| 53 | +) |
47 | 54 |
|
48 | 55 | animations = AnimationSequence(
|
49 | 56 | custom_color_chase_rainbow,
|
|
52 | 59 | custom_color_chase_bgp,
|
53 | 60 | custom_color_chase_br,
|
54 | 61 | advance_interval=6,
|
55 |
| - #advance_on_cycle_complete=True, |
| 62 | + # advance_on_cycle_complete=True, |
56 | 63 | auto_clear=True,
|
57 | 64 | )
|
58 | 65 |
|
|
0 commit comments