Howdy, I need some advice on how to go about adding RGBW support that

Howdy, I need some advice on how to go about adding RGBW support that works with the parallel LED support that was added in the latest release of FastLED.

The nitty gritty details are in a pull request against my own github repo (see link).

The long & skinny of it is what I’ve written so far looks like crap (it results in the lights flickering–not due to a signaling issue, but because of the dithered output). I suspect the reason why is that I’m first converting the RGB data into RGBW and then dithering and scaling the result. What I think I need to do is first dither & scale the RGB data and then convert to RGBW.

However, in order to go from RGB to RGBW I need the exact values for red, green and blue. Unfortunately, at least for the ESP8266 controller, it generates these in between sending each color channel. For this to work, I’ll need to pre-compute the output each time “advanceData()” is called in the PixelController. My concern is this will stall out the CPU and trash the bit-banged signal that gets sent out of the GPIO pin.

I’d love for anybody familiar with the PixelController and ClocklessBlockController code to chime in!

Thanks!!
https://github.com/coryking/FastLED/pull/1

Welcome to why full RGBW support in FastLED is resulting in a near rewrite of the entire library, including the CRGB class, the controllers, pixel controller, etc… :slight_smile: The good thing is the rewrite will make it easy to support RGBW, RGBWWW (or really, any six channel led setup), as well as 16 bit color. I’m hoping to start back up on working on it in the next few weeks.

@Daniel_Garcia I’m very much looking forward to it!!! In the super short term do you think I’m on the right track? Can I safely precompute the RGB->dither->scale->RGBW stuff on every call to advanceData() and have the loadAndScale() stuff return the precomputed values?

This particular display is gonna go in a family members baby room for xmas. If it looks like crap, the Wife Approval Factor in their family will be significantly lower – especially considering we are going to running wires through their ceiling and stuff :slight_smile:

PS: On multi-core controllers like the ESP32, It would be cool to have it do all the dithering and scaling on a separate CPU…

You might be able to - you have about 9us between pixels before they reset. It depends on how expensive your conversion function is and how many lanes are being done.

conversion is pretty cheap. It is just subtracting out the minimum value shared by all three color channels and using it for the white value.

Your dither & scale stuff seem like they might be more expensive than the conversion…