todbot / blink1

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

Fail to Set Individual LED RGB Color (command: 'n') for mk2 Devices #680

Open vt128 opened 10 months ago

vt128 commented 10 months ago

Hi Tod,

I've encountered a problem while attempting to set the RGB color of individual LEDs using the Set RGB color now command detailed in the HID command documentation. The command format I've been utilizing is { 1, 'n', r, g, b, 0, 0, n } (*).

My observation is that attempting to set the color of a specific LED (i.e. n > 0, n in the byte[7]) leads to an issue where all the LEDs switch to white ⚪, disregarding the provided RGB values. This issue persists no matter the individual RGB values I input. Interestingly, when I set the LED number (n) to 0, the command correctly sets all LEDs to the specified color.

Upon inspecting the corresponding code block of the mk2 firmware (located here), I discovered that the LedN > 0 case steers to the method setLED( c.r, c.g, c.b, ledn );. I'm unable to identify the definition of the setLED method in the current codebase (maybe I didn't find the correct file 😢).

Could you please tell me know if this is a bug 🐛 or by design?

vt128 commented 10 months ago

I would like to also mention a related observation concerning the CLI tool implementation. I noticed that in this section of the code, the arguments for ledn appear to be overlooked entirely. I am curious to know if there is a specific reason for this implementation, as it may provide some insight into the issues experienced with the Set RGB color now command in the mk2 firmware.

Look forward to your response!