-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Neopixel library doesn't support RGBW LEDs #2478
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
Comments
4 byte colors are mentioned in PR that added |
There are 3 common versions of the LED strips. Each letter below represents a pixel colour.
You may need to change the order of the bytes in the array when adding The current MicroPython NeoPixel class only deals with GRB. The Adafruit Arduino library supports all permutations for R,G,B,W with macros. |
I wonder if we'll see GRBW pixels or some other order variation. I don't know that much about LED strips to know how likely that is though. |
You can always specify the colors in a different order -- as long as you have support for the given number of colors. This is a little bit harder with |
By the way, I'm not sure if it's a good idea (probably not), but it would be possible to have a single class that just behaved differently depending on whether the color is specified as a triple or quintuple. That won't work for |
The underlying esp.neopixel_write function does not need to change because the timing is the same. It's just the Python wrapper class.
It would be possible to generalise NeoPixel class to take as an argument (to the constructor) the number of bytes per pixel, eg: |
Actually, it's not as easy as I thought, because for bpp=3 you have a different ordering of the RGB values compared to bpp=4. And to support different orderings would mean a lot of extra code. So it's probably simpler (less code, more efficient) to just have a NeoPixelRGBW class. |
I was quoting the label which says RGBW, but the internal ordering on these strips is actually the same as the current code. I didn't realize I had some colors crossed. So everything does work as expected just by changing the multiplier and adding an entry to the tuple |
Hi, |
The driver now supports RGBW LEDs (see above). |
Naively, I didn't take into account that these LEDs were RGBW, so I tried running the example code:
Of course, that results in odd behavior. Not all LEDs light up, or light up in odd colors.
Simply changing the
3
to4
forself.buf
and adding aw
entry to the tuple in neopixel.py makes it work correctly. Of course, doing that directly would break it for folks with regular RGB LEDs. What would be the appropriate design choice here?I'd be willing to submit a PR if you folks tell me how you want it to act.
The text was updated successfully, but these errors were encountered: