Use hue
Use hue and offset to calculate LED colour, so that we get a rainbow across all available LEDs that moves across the string.
This commit is contained in:
parent
296dd34bc4
commit
fbed06ec59
@ -22,6 +22,6 @@ while True:
|
|||||||
|
|
||||||
for i in range(NUM_LEDS):
|
for i in range(NUM_LEDS):
|
||||||
hue = float(i) / NUM_LEDS
|
hue = float(i) / NUM_LEDS
|
||||||
led_strip.set_hsv(i, offset, 1.0, 1.0)
|
led_strip.set_hsv(i, hue+offset, 1.0, 1.0)
|
||||||
|
|
||||||
time.sleep(1.0 / 60)
|
time.sleep(1.0 / 60)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user