blink1 icon indicating copy to clipboard operation
blink1 copied to clipboard

Set RGB color now (Command 'n') not supporting LED2?

Open twaelti opened this issue 8 years ago • 1 comments

While working on #171, i found a strange issue: While FadeToColor (command code 'c') works well with 0 for both LEDs and 1 or 2 for LED1 or LED2, doing the same using SetToColor (command code 'n') wasn't entirely consistent: it only worked with 0 for both LEDs and 1 LED1 - however, using a value of 2 for LED2 only seemed to turn off LED 2, but it wasn't being set to any color afterwards.

Can someone please verify this with other tools on other platforms? My blink(1) has firmware V204, Serial 20004xxx. On my first glimpse into https://github.com/todbot/blink1/blob/master/hardware/firmware_mk2/main.c, I couldn't discover anything unusual.

Thanks -Tom

twaelti avatar Sep 29 '15 11:09 twaelti

There's currently a bug in the SetToColor ('n') command in that it uses the last-used value of ledn instead of heeding the value in the SetToColor command.

As a work-around, I would recommend using FadeToColor ('c') with a zero time ticks as the implementation of your library's SetToColor. (e.g. USB HID report { 1, 'c', r,g,b, 0,0, ledn }})

todbot avatar Oct 15 '15 20:10 todbot