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)

Ryan Schuster
  • 125
  • 1
  • 6
  • 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 01 '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 01 '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 02 '15 at 14:56

1 Answers1

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.

jojonl
  • 118
  • 13