Square only 7 leds working in mode 0 (python)

See my code below , am i doing something wrong?

import time
from blinkstick import blinkstick
from random import randint
red = randint(0, 63)
green = randint(0, 63)
blue = randint(0, 63)
x=0
#Find the first BlinkStick
bstick = blinkstick.find_first()

bstick.set_mode(0) #
while(1):
	for a in range(0,8):
		red = randint(0, 63)
		green = randint(0, 63)
		blue = randint(0, 63)
		bstick.set_color(0, a, red, green, blue)
		time.sleep(0.01)
	time.sleep(2)
bstick.set_color(0)

Square does not support mode 0, it’s only for BlinkStick Pro.

Use the following command to reset the mode to normal WS2812:

blinkstick --set-mode 2

Then unplug and plug the device back into the PC. You need to do only once.

Update your script to this:

import time
from blinkstick import blinkstick
from random import randint

#Find the first BlinkStick
bstick = blinkstick.find_first()

while(1):
    for a in range(0,8):
        red = randint(0, 63)
        green = randint(0, 63)
        blue = randint(0, 63)
        bstick.set_color(0, a, red, green, blue)
        #Would suggest adding a 20ms timeout before setting next color
        time.sleep(0.02) 
    time.sleep(2)

LMK if the last LED lights up.

I’m using on windows so i dont have the blinkstick tool.

cant i use bstick.set_mode(2) in my script?

Yep, you can use that. Just need to do it once. Add delay after you set the mode to about 20ms.

It works now , thank you.

I couldnt find it in the online manual for set_mode function.

I found this but found it rather misleading:

set_mode(self, mode)
Set device mode for BlinkStick Pro.

Square is a derivative of Pro, you are right, the documentation is lacking a bit. Will update and thanks for pointing this out! :smiley:

nice , thank you :smiley:

I’m glad you made the new nano , been waiting for that small footprint for a long time.
Will have to order one i’m sure

Thanks :smiley: First prototype was a bit bigger, but decided to use the connector directly on the board.