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)

  • 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), – Steve Robillard Oct 1 '15 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 '15 at 16:07
  • Good pro tip about testing, @SteveRobillard joan I had no idea this was a thing! Good to know... – Ryan Schuster Oct 2 '15 at 14:56
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
    Hah! Good to know. I inherited all of this equipment but I guess not I know to check for GRB vs RGB. – Ryan Schuster Oct 2 '15 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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