-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request - Support for 5-channel pixels like WS2805 RGBCCT #395
Comments
following |
I won't be the one to do it, but for any (sane) architecture you care about and control, the needed modifications aren't hard. There's already support for four-bulb strips; the fifth bulb (cool white vs. warm white) appears in the protocol in the "obvious" way. Roll up your sleeves and tackle it (together, if need be). On the wire, the protocol is the same. The difference is in the stride. Instead of counting Green, Red, Blue, [ White ], you just have to count off G, R, B, CW, WW. (Maybe the two whites are the other direction; it'll be obvious once you code it...) So mostly you "only" have to change the code actually sizing and populating the pixel buffer, probably starting with approximately Adafruit_NeoPixel/Adafruit_NeoPixel.cpp Line 3393 in aa798ff
The other unfortunate bit of ugliness is that RGB and RGBW, with 8-bit values in each, fit into a 32-bit value easily. This means that uint32_t argument for pixel color conveniently holds one white value, but needs some kind of a sidecar for a second white one. Maybe you add another argument. Maybe you just make that function leave that fifth pixel blank and have another new function that runs along the pixel array and fills it in. There are lots of ways to do it and most of them really aren't THAT hard. But that's the function that neesd to know there are five cards to count off (not three (RGB) and not four (RGBW)) Code like Adafruit_NeoPixel/Adafruit_NeoPixel.cpp Line 150 in aa798ff
Adafruit_NeoPixel/Adafruit_NeoPixel.cpp Line 3708 in aa798ff
The hard part about submitting a change like this to a project like this is the need to build (and hopefully test) everything from a 8-bit atmega to a dual-core K210 or Pi. If you have to be the one to support every combination of clock speed, every ATMega ever made (in assembly language) every possible ordering of R, G, B, CW, WW, and the responsibility to NOT break the code for others, it's not very much fun. See that "prime directive" in the doc. For a hobbyist project on an ESP32, one specific strip, and code that never had to work anywhere else, this is probably a fifteen minute task. (I'm not exaggerating.) If Adafruit themselves sent me a blank purchase order to do this, and a box of all the hardware here and I had to set up cross environments, learn AVR assembly and figure out how to count the exact number of clock cycles taken in every case (do more work, but still has to be 64 btyes long? Ick!), verify I didn't change any function signature to violate that "prime directive", etc. I'd decline to bid. THAT'S the difference in a hobbyist project and changing code like this. So this is easy (on a grown-up CPU) to do 'well enough' but difficult to do well. It's literally just making space for five bulbs instead of 3 or 4 as is there now. (Source: Was a professional programmer at the top of the game. I still work on a couple of LED projects like this and have these very strips.) P.S. I'll stand on the sidelines and coach in this FR if one of you wants to run with it and ask questions. I just won't do the work. |
Is it possible to add support for these pixels?
Here is an example product. https://www.btf-lighting.com/collections/ws2805-rgbcct-24v
I ordered some, it should arrive within the next days, then I'd be happy to test anything needed.
Thank you
The text was updated successfully, but these errors were encountered: