-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersnodejsNodejs SDKNodejs SDKpythonPython SDKPython SDK
Description
In both implementations for "streaming frame" (python and nodejs), what the communitysdk does is to encode and send a list of 128 color values: One for each LED.
This list is a one dimensional representation of a two dimensional matrix of LEDs so to set the color of an LED by the x and y coordinate we need to convert a pair of coordinates (x, y) into an index in the unidimensional list.
The math is not complicated, for example if you want to set this color to red (#ff0000) all you have to do is to set a value in the frame array:
index = (x * 16) + y
frame[index] = '#ff0000'
# stream frame hereIt would be great to have a method inside the communitysdk to solve this issue and/or an example on how to do this calculation.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersnodejsNodejs SDKNodejs SDKpythonPython SDKPython SDK