-
-
Notifications
You must be signed in to change notification settings - Fork 40k
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
add definition WS2812_BYTE_ORDER to fix RGB LED issues #10184
Conversation
This should probably be made more generic just in case there are other WS2812 parts with this/other byte orders. eg. |
making this more generic, will update |
@fauxpark updated! |
This PR will also need to be retargeted and rebased onto |
This won't work for any of the ChibiOS drivers, as they have to manipulate the data as it goes out. |
I've actually got some WS2812C-2020's already, will see if I can get something breadboardable for testing purposes. EDIT: Never mind, was the B's that have the reversed order. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aligning docs to match tz's suggested changes.
@tzarc I would definitely appreciate help with the ChibiOS side as I don't have any development platforms currently, nor do I plan to have any in the near future. |
Should be relatively straightforward, based on the
|
@tzarc for testing, you can still use the WS2812C's - the code will do the opposite however. when |
Thank you for your contribution! |
Ws2812 byte order 2
Co-authored-by: Ryan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight __attribute__ ((weak))
✔️
* add define for WS2812B-2020 to fix RGB issues * update driver doc * add WS2812_BYTE_ORDER definition to correct RGB byte issues * add definition variable thing * update per PR request * update per PR reqs * update per PR request * inital changes * move defines to color.h and add rgbw incase * Update docs/ws2812_driver.md Co-authored-by: Ryan <[email protected]> Co-authored-by: hineybush <[email protected]> Co-authored-by: Xelus22 <[email protected]> Co-authored-by: Ryan <[email protected]>
* add define for WS2812B-2020 to fix RGB issues * update driver doc * add WS2812_BYTE_ORDER definition to correct RGB byte issues * add definition variable thing * update per PR request * update per PR reqs * update per PR request * inital changes * move defines to color.h and add rgbw incase * Update docs/ws2812_driver.md Co-authored-by: Ryan <[email protected]> Co-authored-by: hineybush <[email protected]> Co-authored-by: Xelus22 <[email protected]> Co-authored-by: Ryan <[email protected]>
* add define for WS2812B-2020 to fix RGB issues * update driver doc * add WS2812_BYTE_ORDER definition to correct RGB byte issues * add definition variable thing * update per PR request * update per PR reqs * update per PR request * inital changes * move defines to color.h and add rgbw incase * Update docs/ws2812_driver.md Co-authored-by: Ryan <[email protected]> Co-authored-by: hineybush <[email protected]> Co-authored-by: Xelus22 <[email protected]> Co-authored-by: Ryan <[email protected]>
* add define for WS2812B-2020 to fix RGB issues * update driver doc * add WS2812_BYTE_ORDER definition to correct RGB byte issues * add definition variable thing * update per PR request * update per PR reqs * update per PR request * inital changes * move defines to color.h and add rgbw incase * Update docs/ws2812_driver.md Co-authored-by: Ryan <[email protected]> Co-authored-by: hineybush <[email protected]> Co-authored-by: Xelus22 <[email protected]> Co-authored-by: Ryan <[email protected]>
Description
While flashing and repairing some hbcp PCBs, I realized that the LEDs were not showing the correct color - specifically that the red and green channels were reversed. The LEDs on the board are WS2812B-2020 from WorldSemi. I replaced one LED with a WS2812C-2020, and it was the correct colors, according to the VIA output (and QMK). After examining the datasheets for each LED, I found that even though the software is the same (G, R then B, 1 byte each) the hardware is not - the red and green LEDs are reversed physically!
https://i.imgur.com/kB3mPyI.jpg
https://i.imgur.com/dmB1aY1.png
I created a definition,
WS2812_BYTE_ORDER
in color.h to define the byte order for the LED. The RGB definition swaps the R and G bytes and corrects the color issue.https://i.imgur.com/sLcRLYU.jpg
If WS2812B-2020 LEDs are used,
#define WS2812_BYTE_ORDER WS2812_BYTE_ORDER_RGB
should be placed in theconfig.h
file. I tested this successfully with the hbcp code.This added definition should not affect any other existing PCBs without it, due to defaulting to the "standard" GRB structure. I tested this with a few PCBs I had on hand, namely h88, h87a and some prototypes.
Thanks to @Xelus22 for the assistance.
Types of Changes
Issues Fixed or Closed by This PR
Checklist