Skip to content

Setting colors for individual LEDs on Pixel Kit #15

@murilopolese

Description

@murilopolese

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 here

It would be great to have a method inside the communitysdk to solve this issue and/or an example on how to do this calculation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions