todbot / blink1

Official software for blink(1) USB RGB LED by ThingM
https://blink1.thingm.com/
Other
953 stars 237 forks source link

Issue with 'W' Command "Save color patterns" on blink(1) device #684

Open mukirkland opened 8 months ago

mukirkland commented 8 months ago

I am encountering a problem with the 'W' command, as outlined in the HID command document.

As per the given structure { 1, 'W', 0,0,0, 0,0, 0 }, this command should enable me to "Save color patterns" to Flash. Unfortunately, this command doesn't seem to function properly on my blink(1) device.

While trying to use the 'W' command to save color patterns, the command fails to execute successfully, without any visible changes or error messages in the blink(1) device, and patterns hadn't been kept after the power off.

todbot commented 8 months ago

The 'W' command is used to save the current pattern in RAM to flash.
The 'P' command changes a single color pattern line. Please try using the command-line program blink1-tool to exercise these commands. You can see how they're implemented in the accompanying blink1-lib.c library. (specifically, the blink1_writePatternLine() and blink1_savePattern() functions)

For example:

# Change the 2nd color pattern line to #112233 with a 0.5 sec fade
blink1-tool -m 500 --rgb 112233 --setpattline 1 
# Write entire pattern from RAM to flash
blink1-tool --savepattern 

If blink1-tool --savepattern is not done, any changes to the RAM pattern will be lost when powered off and the flash pattern gets reloaded into RAM.