GRB and RGB with OctoWS2811

Status
Not open for further replies.
Hello! I have to use 2 types of WS2811 strip - GRB and RGB - for the same setup. Is it possible to address them separately using OctoWS2811 lib?

When I create 2 configs:
const int config = WS2811_GRB | WS2811_800kHz;
const int config_BIG = WS2811_RGB | WS2811_800kHz;

and then initialize 2 OctoWS2811 objects:
OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);
OctoWS2811 leds_BIG(ledsPerStripBIG, displayMemoryBIG, drawingMemoryBIG, config_BIG);

only the latter one is used.
 
The library certainly wasn't meant to be used this way.

With only a minor edit to the library I believe this should "work". Inside OctoWS2811.h, look for this line:

Code:
        static uint16_t stripLen;
        static void *frameBuffer;
        static void *drawBuffer;
        static uint8_t params;
        static DMAChannel dma1, dma2, dma3;

For each instance to have a separate drawing buffer and its own config, you'll need to remove "static" from drawBuffer and params. You may also need to delete the global scope variables for these in OctoWS2811.h, if the compiler complains.

You can probably use the same buffer for the display memory.

While I believe this can "work", I'm not quite understanding how it could be useful. Both instances are going to send whatever you've drawn to the same 8 pins. So unless you've also doing some crafty hardware mux to switch the signals over to a physically different set of LEDs, I don't see how this would be useful.

But if you want to do it anyway, hopefully this pointer to the static variables will help you achieve it.
 
Status
Not open for further replies.
Back
Top