Last active
April 2, 2020 19:17
-
-
Save hputzek/68575bc56dae342c8ca42334c33a509d to your computer and use it in GitHub Desktop.
potential-frame-schema.js (Pixelcrasher/pusher)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a potential structure for a frame object | |
const exampleFrame = { | |
'controllerId': { | |
// Pixelpusher knows how to process this from the controller metadata | |
// alternative 1: Put each pixel in an array, if the array has length of 3 | |
// it means RGB, if length===4 it means RGBW | |
'channelId': [[255,0,0], [0,0,0,255], ['more pixels here...']], | |
// alternative 2: send one big array of r/g/b(w) values | |
'channelId': [255,0,0, 0,0,0,255,'more color values here...'], | |
}, | |
'controllerId': { | |
'channelId': [255,0,0, 0,0,0,255,'more color values here...'], | |
'channelId': [[255,0,0], [0,0,0,255], ['more pixels here...']], | |
} | |
} | |
// Idea: later on we could also have a channel type "json" which can be used to push a JSON String to | |
// the controller, where it can be parsed with Arduino JSON. This can be very helpful to send configuration data | |
// back and forth. | |
const exampleFrameUsingJsonChannel = { | |
'controllerId': { | |
'channelId': { | |
redLedOn: true, | |
greenLedOn: false, | |
bluethoothConnected: false, | |
rgbLed: [255,0,0] | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment