I am using a simple while loop and an array to chase LEDs on a strip.
while True:
for i in range(nLEDs):
R = [ 255 ] * nLEDs
G = [ 255 ] * nLEDs
B = [ 255 ] * nLEDs
intensity = [ 0 ] * nLEDs
intensity[i] = 1
setLEDs(R, G, B, intensity)
time.sleep(0.05)
What would be the most elegant way to chase to the end and back repeatedly (kind of like a bouncing ball)?