Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

confusing ledn definition for read current color cmd #676

Open
Pro2Factory opened this issue Sep 20, 2023 · 0 comments
Open

confusing ledn definition for read current color cmd #676

Pro2Factory opened this issue Sep 20, 2023 · 0 comments

Comments

@Pro2Factory
Copy link

In the HID doc (https://github.com/todbot/blink1/blob/4df2d06215b5c1c9221f3cfd91ef8e550a681e7f/docs/blink1-hid-commands.md?plain=1#L148C1-L161C48):

### Read current color - `format:  {0x01, 'r', 0,0,0,       0,0, n }` 

return values:

    hid_send_buf[0] = 0x01 (report_id)
    hid_send_buf[1] = 'r'
    hid_send_buf[2] = leds[ledn].r;
    hid_send_buf[3] = leds[ledn].g;
    hid_send_buf[4] = leds[ledn].b;
    hid_send_buf[5] = 0;
    hid_send_buf[6] = 0;
    hid_send_buf[7] = ledn;

where ledn is 0 (one led) or 1 (the other led).

But testing with mk2 via cli tool (https://github.com/todbot/blink1-tool), the definition is different:

  1. Set color
blink1-tool --rgb="FF0000" --led 1 -m 0
blink1-tool --rgb="00FF00" --led 2 -m 0
  1. Get color with ledn:
blink1-tool --rgbread -l 0
blink1-tool --rgbread -l 1
blink1-tool --rgbread -l 2

here's the Result:

reading led 0 rgb: 0xff,0x00,0x00
reading led 1 rgb: 0xff,0x00,0x00
reading led 2 rgb: 0x00,0xff,0x00

thus --- in the result, led0 and led1 is the same, and led 2 is the other, which is different from the hid doc saying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant