martinberlin / pixels

Simple library for controlling LED chains
GNU General Public License v3.0
0 stars 0 forks source link

Make header 2->3 unsigned 16 bits and send in 2 chunks #3

Open martinberlin opened 4 years ago

martinberlin commented 4 years ago

Same as header 4-5 that specify the total stripe length, I'm going to use this still non used header bytes to specify channel length. Let's imagine we have two 44x11 panels (484 RGB pixels) we are going to send:

P chunk size 2-3 total length 4-5
80 484 986

We are going to send a max. chunk size per Channel, so we will declare 2 stripes:

// RGB 3 bytes * pixel
NeoPixelBus<NeoGrbFeature, NeoEsp32Rmt0Ws2812xMethod> strip1(484, PIXELPIN);
NeoPixelBus<NeoGrbFeature, NeoEsp32Rmt1Ws2812xMethod> strip2(484, PIXELPIN+1); // gpio20

So in the show() instead of sending the hole total length in one channel, I'm going to split the output in the received chunk size (header bytes 2-3) and send this first part to strip1, and the remaining RGB payload to strip2.