RGB Led Strip


I’m trying to control a rgb led strip with my FEZ Domino. I wan’t to cycle through colors in the end with a webpage where I can select a color and the strip is set to that color.

This is what I tried:

static PWM red = new PWM((PWM.Pin)FEZ_Pin.PWM.Di10);
static PWM green = new PWM((PWM.Pin)FEZ_Pin.PWM.Di9);
static PWM blue = new PWM((PWM.Pin)FEZ_Pin.PWM.Di8);

red.Set(20000, 10);
blue.Set(20000, 0);
green.Set(20000, 0);

The red lights up more then the other colors, but I can’t set the other colors to “black” (off). Does anyone have some sample RGB PWM code?



This looks correct, you probably have the wiring wrong?

Well, actually it does work, I can set the different colors, but I just can’t seem to set it to one color only… if I set red to 10, blue to 0 and green to 0 I expect only the red led’s to light up (a bit) and the blue and green stay off, but they all light up a bit, the red a bit more then the others…

10 and 0 are very close numbers

Try 90 and 10, instead of 100 and 0.

The human eye does not see pwn pulsed light as a linear scale. Usualy devices using PWM to dim lights are using a “gamma table” for convert linear human light levels to PWM %. For an example the human eyes sees no difference between 75 and 100% PWM.

This is all about the difference between Luminance vs. Brightness

Some interesting information : http://arduino.cc/forum/index.php?topic=69083.0

Have fun :wink:


The eye responds differently to the different colors. Try to use for green 0.5 of what you want.
At least my RGB leds show white only with R and B values doubled compared to the G value.

Normally RGB Leds are designed taking this into account and the 3 chips are of different “light-power” (given either in millicanda or lumen) so that the sum of all 3 with the same current should give white.