Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 19:14 27 Mar 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Electronics : WS2812 BGR possible instead of RGB?

Author Message
wolfme
Newbie

Joined: 26/10/2021
Location: Germany
Posts: 31
Posted: 08:42pm 17 Jan 2025
Copy link to clipboard 
Print this post

Is it possible to drive BGR WS2812 LEDs?

SetPin GP16, DOUT
WS2812 B, GP16, 1, RGB(red)


lights up the LED green and

SetPin GP16, DOUT
WS2812 B, GP16, 1, RGB(green)


lights up the LED red
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2374
Posted: 10:56pm 17 Jan 2025
Copy link to clipboard 
Print this post

@Mixtel90 also found some with wrong colours.https://www.thebackshed.com/forum/ViewTopic.php?TID=17173&PID=225831#225831#225831 Though he didn't show his solution it would just require transposing the colours. See if this works
OriginalColour = RGB(red,green,blue)
TransposedColour =((OriginalColour >> 8)And &HFF00)+((OriginalColour<<8)And &HFF0000)+((OriginalColour)And &HFF)
WS2812 B, GP16, 1, TransposedColour
 
wolfme
Newbie

Joined: 26/10/2021
Location: Germany
Posts: 31
Posted: 06:27am 18 Jan 2025
Copy link to clipboard 
Print this post

  phil99 said  @Mixtel90 also found some with wrong colours.https://www.thebackshed.com/forum/ViewTopic.php?TID=17173&PID=225831#225831#225831 Though he didn't show his solution it would just require transposing the colours. See if this works
OriginalColour = RGB(red,green,blue)
TransposedColour =((OriginalColour >> 8)And &HFF00)+((OriginalColour<<8)And &HFF0000)+((OriginalColour)And &HFF)
WS2812 B, GP16, 1, TransposedColour


That works, thanks very much!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2025