arvydas / blinkstick-python

BlinkStick Python interface to control devices connected to the computer
Other
136 stars 53 forks source link

FLASH Memory State Stuck #78

Open Arch-druid opened 2 years ago

Arch-druid commented 2 years ago

On my Blinkstrip PRO, I engaged ALL leds (24 total: 2 channels, 12 indexes on each channel) to color white. Now, when I remove the strip and put in ANY computer, it remains white, and I am unable to modify the led lights in any way. Do you guys have an approach for torubleshooting this issue? My belief is that the flash memory of some sorts has been written and it is not overwritten in the conventional way, so we would need to find a way to return it to a different state in order to begin receiving new instruction again. Thanks!

Arch-druid commented 2 years ago

UPDATE:

Apparently, the blinkstick is equipped with EEPROM memory, so one needs to ensure that the "mode" state is set appropriately. I didn't necessarily "fix" the issue, but I found a workaround to provide satisfactory results:

For some context, I am programming the blinkstick in python (using the latest version of atom. If you ain't using atom, YOU'RE DOING IT WRONG) and have installed the necessary packages on atom to run python script directly in the atom environment. Python 3.10.2 has already been installed, environment variable has been pathed, and we are ready to rumble.

At this point, you could throw some code directly into atom, press CTRL+SHFT+B or whatever your "run script" command is, and have the fruits of your minimally intensive labor illuminated on your led array. The thing to note here is that I BELIEVE THE DEFAULT MODE IS SET TO 2. IF YOU CHANGE THE MODE IN ANOTHER WAY, YOU CAN RUN INTO PROBLEMS TRYING TO PERFORM OPERATIONS THAT ARE ONLY PERMITTED THROUGH MODE 2.

Have some fun flipping through modes and see what works. Here is my code; just pop it into atom and change up the value in the bstick.set_mode variable to see how that influences your LED light array. Play around with the channel or index to see at what point you have a red LED show up on your stick, and it should allow you to figuratively "calibrate" your understanding of how the modes alter your ability to program the blinkstick.

#Import blinkstick module
from blinkstick import blinkstick

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

print(bstick.get_serial())

#Set the color red on the 12th LED of R channel
#bstick.set_color(channel=0, index=3, name='red')

print(bstick.get_mode())
bstick.set_mode(2)
print(bstick.get_mode())

from blinkstick import blinkstick

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

#Set the color red on the 12th LED of R channel
bstick.set_color(channel=0, index=12, name="red")
print(bstick.get_color(channel=0, index=12))