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

Selecting individual LED on blinkstick #5

Open
sirchuck opened this issue Nov 20, 2018 · 3 comments
Open

Selecting individual LED on blinkstick #5

sirchuck opened this issue Nov 20, 2018 · 3 comments

Comments

@sirchuck
Copy link

I couldn't find in the code how to set the color of a particular led on my blinkstick. The sample code does light up the first LED on my stick, but I can't do anything with the rest of the LED's.

This is the item I purchased:
https://www.blinkstick.com/products/blinkstick-strip

If you feel like updating the project to handle more than one LED that would be cool. :)

@boombuler
Copy link
Owner

Could you try, how it behaves If you change the hardcoded 1 at blinkstick.go?

@sirchuck
Copy link
Author

I tried a few numbers and got some interesting behavior.
0x01 lights the first LED
0x02, 0x03, 0x04 do nothing
0x05 lights all 8 lights with wrong colors.
0x06, 0x07, 0x08, 0x09 first LED again
0x10-0x50 nothing

So it'll be a guessing game, but with time probably hackable assuming the first byte does address the LED's.

return d.WriteFeature([]byte{0x01, byte(r >> 8), byte(g >> 8), byte(b >> 8)})

@rikkuness
Copy link

Sorry to necro, but I've just been playing with this and it looks like to address individual LED's you need to change the byte array you write to be something like this, changing the third byte to be the index of the LED you want to set

return d.WriteFeature([]byte{
	0x05, // report id for indexed colour
	0x00, // RGB channel
	0x00, // LED index
	byte(r >> 8),
	byte(g >> 8),
	byte(b >> 8),
})

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

3 participants