File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 15
15
16
16
def color_wipe (color , wait ):
17
17
"""Color wipe animation. Wipes across all pixels."""
18
- for i in range (num_pixels ):
19
- pixels [i ] = color
18
+ for pixel in range (num_pixels ):
19
+ pixels [pixel ] = color
20
20
time .sleep (wait )
21
21
pixels .show ()
22
22
time .sleep (0.5 )
23
23
24
24
25
25
def rainbow_cycle (wait ):
26
26
"""Rainbow cycle animation. Cycles across all pixels."""
27
- for j in range (255 ):
28
- for i in range (num_pixels ):
29
- rc_index = (i * 256 // num_pixels ) + j
30
- pixels [i ] = adafruit_pypixelbuf .colorwheel (rc_index & 255 )
27
+ for color_index in range (255 ):
28
+ for pixel in range (num_pixels ):
29
+ pixel_index = (pixel * 256 // num_pixels ) + color_index
30
+ pixels [i ] = adafruit_pypixelbuf .colorwheel (pixel_index & 255 )
31
31
pixels .show ()
32
32
time .sleep (wait )
33
33
You can’t perform that action at this time.
0 commit comments