2

I'm using a Pi to drive a Fadecandy board to light up a varying-length string of RGB LEDs in different, pulsating colors. I've been successful, however one snag I ran into along the way was programmatically defining the LED colors in RGB.

I copied the Fadecandy example program measuringstick.py (which makes every 10th LED green and the rest white) and tweaked it to create a rainbow of colors instead. Wrote the program into /etc/rc.local, rebooted the Pi, and noticed that my colors were completely off! After a half hour of messing around, I realized that defining the colors in GRB instead of RGB gave the correct result. In other words, if I want an LED to be bright red I have to define its color as (0,255,0) instead of (255,0,0).

Is this a normal thing with LED pixels? All of the example code was written in RGB, so I assume that GRB is not normal. Can someone explain to me what's going on? I'm more curious than anything at this point.

(Sorry I don't have any code to show you. My collaborator has the lights/Pi with him today)

3
  • 1
    It depends on the specific led's the majority are RGB but I have some that are GRB. That is why I always test with just (255, 0, 0), (0, 255, 0), (0, 0, 255), Oct 1, 2015 at 16:06
  • There are dozens of different RGB LED strips. I'd say the most likely explanation is that yours are written in GRB order rather than RGB.
    – joan
    Oct 1, 2015 at 16:07
  • Good pro tip about testing, @SteveRobillard joan I had no idea this was a thing! Good to know... Oct 2, 2015 at 14:56

1 Answer 1

2

If you buy cheap RGB LED's from china, you can get GRB mixed with RGB's. Happend to me a few times. Then I decided to pay a bit more to be sure I get what I order.

1
  • 1
    Hah! Good to know. I inherited all of this equipment but I guess not I know to check for GRB vs RGB. Oct 2, 2015 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.