Hello,
I’m trying to set individual LEDs of my Blinkstick Square to different colours using Python.
When I use the command
bstick.set_color(channel=0, index=x, name=“green”)
where x is a value between 1 and 7, it correctly sets that light, and only that light, to green.
However, when I use
bstick.set_color(channel=0, index=0, name=“green”)
It sets all of the lights to green.
I wondered if index 0 was meant to be for all of them, and perhaps there was a different index value for setting light 0, but 8 does nothing and -1 also does nothing.
Here is my code:
from blinkstick import blinkstick
import time
bstick = blinkstick.find_first()
bstick.turn_off()
time.sleep(1)
for x in range(8):
bstick.set_color(channel=0, index=x, name=“green”)
time.sleep(1)
The desired result is that each light, starting with light 0, will turn on one at a time (with a one second delay) but right now they just turn on all at once. However, I know time.sleep() is working correctly because when I run the loop for x in range (1,8) it works properly exempt for LED 0 not turning on at all.
I get this same behaviour on my windows PC, and also on a raspberry Pi running Linux.
Any suggestions?
Thanks