Skip to content

Commit a19ecc7

Browse files
committed
Update variables for clarity.
1 parent 0ac963a commit a19ecc7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

QT_Py_NeoPixels/QT_Py_NeoPixel_Animations.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515

1616
def color_wipe(color, wait):
1717
"""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
2020
time.sleep(wait)
2121
pixels.show()
2222
time.sleep(0.5)
2323

2424

2525
def rainbow_cycle(wait):
2626
"""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)
3131
pixels.show()
3232
time.sleep(wait)
3333

0 commit comments

Comments
 (0)