Fastled: RGB to RGBW

Created on 30 Nov 2014  路  21Comments  路  Source: FastLED/FastLED

Hello,

I'm working on a project with RGBW leds. I would love to used Fastled, but its seems quite difficult to adapt the librairie for RGBW leds, as every functions are for RGB.
Is there a way to use it, without changing code lines ?

I'm a bit lost.

Most helpful comment

(and yes, i've already started the work on this - there's a private branch that has the beginnings of the major architectural changes that will be necessary to allow the drivers to switch between rgb/rgbw code as well as some other, more dynamic output that's looking further down the line for 16-bit rgb/rgbw support)

All 21 comments

There isn't, at the moment. RGBW support will require some major re-working of the library that's planned, but not done yet. Not the least of which is because I don't yet have access to any RGBW strips.

Maybe there is an easy way:

Use the lib with RGB (without W) and before sending to hardware calculate the W as the K in CMYK - blending to W if saturation in RGB is low.

I am planning to implement this algorithem when my RGBW-stripe arrives...

If your rgbw strip is using the ws2812 style protocol this won't work for you still - as that output code is very tightly tied to rgb output. I have some rgbw strips but there are a lot of library changes that will be needed to support rgbw fully.

@focalintent: I dont see much difference between ws2812 style and f.e. sk6812 style strips; the only main difference is that RGB needs 24-bit and RGBW needs 32-bit; with the Adafruit Neopixel library I was even able to control a RGBW strip with 24-bit only (did set number of pixels to 80 but had only 60) before I realized that latest versions support RGBW fully ...; see also:
http://www.szledcolor.com/download/SK6812RGBW.pdf

FastLED does a lot more under the hood than just push bits out - there's the brightness scaling and the color correction. There's the CRGB object that provides way more options when it comes to color setting and manipulation than adafruit's. All of that needs to be expanded to support CRGB and CRGBW objects, as well as writing out CRGB data to rgbw strips and CRGBW data to rgb strips.

OK. But isnt it possible for a start that you introduce a RGBW type with only sending a fillbyte for white so that the chip gets its 32 bits? With this one could at least use FastLED with RGBW strips and use only RGB without white but can still use the great RGB features FastLED provides ...; just an idea.

Even that is a significant amount of work for some of the platforms because of the assembly code that is done to do the output that is pretty tightly arranged (though that is going to be the first step of doing it, so I will be publishing that before full CRGBW support is in place). It's going to take me some time to do, as it's pretty involved code - trust me, I've spent a bunch of time thinking about and working on this already. (Not to mention the fact that it is code that needs to be adjusted for at least 4 platforms, if not more, and needs to be done in a way that _doesn't_ break RGB strips - and also I'm not interested in doing a throwaway hack in the interest of getting something out the door a couple weeks sooner).

(and yes, i've already started the work on this - there's a private branch that has the beginnings of the major architectural changes that will be necessary to allow the drivers to switch between rgb/rgbw code as well as some other, more dynamic output that's looking further down the line for 16-bit rgb/rgbw support)

Any update on RGBW WS2812 support?
I just moved to RGBW LEDs assuming FastLED would work with these guys, but oh, to my dismay!

I had to stop the work for a few months because of work/life - I'm in the middle of working on it right now, and I'm about 1/3rd of the way done. It's a massive overhaul though, and is practically a rewrite of almost the entire library.

I'll update this ticket/announce on the g+ group when it's ready for people to start testing.

(It will support rgb, rgbw, rgbwww, rgbwau, etc... - as well as 16 bit versions of things)

Awesome! Life has a tendency to make things hard sometimes :D thank you for your continued efforts! I would love to test it when you are ready.

Thank you!
T

Oh man, I just bought some RGBW rings and individual leds thinking FastLED would just work with them. Your library is awesome and going back to the default NeoPixel one is absolutely not an option. Thank you for this project, we are eagerly (yet patiently) waiting for whenever life gives you a bit of a breather :)

As an FYI, I added some basic support for RGBW to the rpi_281x library and Hyperion.

Hyperion internally only does RGB so Ive implemented 2 white algorithms so far. "Off" so your rgbw works as RGB and "subtract minimum" where I drag down r, g and b bu the same amount and use this to set w.

It's not about implementing white-choosing algorithms - FastLED has a lot of complicated code woven in place to handle dithering/brightness adjustment while writing out led data - making that code work smoothly, on all the platforms FastLED supports, for the various combinations of RGB, RGBW, RGBWWW, RGB16, RGBW16, and RGBWWW16 _and_ having the entire library be compatible with whatever pixel definition is being used (and all the combinations of things like RGBW objects writing out to RGB led strips or vice versa, etc... etc... etc...) - it's a lot of deep, complex changes across almost the entirety of the library.

Hi Daniel, i'm very new in this world, but i did a expensive investment in many controllers, components e etc, because i watch your Fastled working, since i saw.. as being hard to sleep, i want put my things working
may you help me with some questions ?
I bought some Wemo D1 ( ESP2866EX based )
and some SK6812 ( WS2812b based )
Are FASTLED compatible with 8266 ? because i'm not getting to compile

second: Is possible use a SK6812/RGBW , but ignoring the W with no changes in code/lib ?

are you from ( BR ? )
thank you in advance

It is compatible with the ESP8266 - make sure you have gotten the latest version of the library from github and that you are using the latest version of the esp8266-arduino package.

It is not yet possible to use RGBW chipsets with FastLED. I'm hoping to publish something that people can start working with in the next few weeks, but there's still a lot of work that I have to get done, first.

Hello Daniel,

i was looking inside m0clockless.h ( between lines 282 -> (+-320) and i found the place that send the 24bits to led strip, i was able duplicate and send 32bits , but i'm far from assembly/c by many years, and today i'm not able to do what i want

i wish only to ignore the white pixel, maybe you can give me a trick to do this
i know you are a perfectionist guy, and do not want to do a hack anyway, but I need to make a presentation and I am unable to use a rgb, then I need to make this material work like this
may you tell how can i put 8 bits ( zero ) more to ignore this W

thank you in advance

I don't have one, I'm sorry - and I'm nailed to the wall with both getting a preview release of actual RGBW support out and an art installation that I have to have finished in the next 10 days, so I don't have the time right now to try to put together a hack for you for sending out the code.

If you are still using the esp8266 you can have something that writes out 0's for white by going into platforms/esp/8266/clockless_esp8266.h and replacing the showRGBInternal function in there with what's in this gist here: https://gist.github.com/focalintent/2680020e65de7fd1f6fc6cf8cea4e716 - but it's a hack, and it might not work.

Thanks Daniel i will start tests now

I got some Wemos D1 mini ( based on ESP8266EX )
compile OK, but only few pins( 13,14,15,7 no compile )
than i'm using D2 -pin4
but never works

did you guys have idea why ? D1 not work if is a ESP8266

The D1 mini is what I'm doing all my work with - what version of arduino esp8266 are you using? You should be using 2.2.0, or as I mentioned above, the latest - 2.3.0. The D1 mini is what I'm actively using for a large installation right now. The PIN numbers you should use for the D1 mini are the D* Numbers on the board, so D1-D8 and make sure that you select D1 mini in arduino. Please move any questions specifically about how to use the ESP8266 to the g+ group - http://FastLED.io/+ -- I really want to leave github issues for bug reports and feature tracking, not general conversation - and I want to leave _this_ issue specifically focused on the rgbw support.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marmilicious picture marmilicious  路  3Comments

mike-belcher picture mike-belcher  路  5Comments

altimmons picture altimmons  路  3Comments

sfranzyshen picture sfranzyshen  路  9Comments

PhilColbert picture PhilColbert  路  7Comments