I'm working on a little project which involves controlling 10 RGB LEDs using my Netduino Plus, and I've run into a slight problem.
I want to be able to have all 10 RGB LEDs on maximum brightness simultaneously, but each with its own PWM values for red, green and blue.
I have tried looping through all 10 LEDs really quickly and turning each one on at a time with its own PWM values set, but the LEDs aren't at maximum brightness. This is a test program I have tried:
public static void Main() { PWM red = new PWM(Pins.GPIO_PIN_D5); PWM green = new PWM(Pins.GPIO_PIN_D6); PWM blue = new PWM(Pins.GPIO_PIN_D9); OutputPort[] leds = new OutputPort[10]; leds[0] = new OutputPort(Pins.GPIO_PIN_D2, false); leds[1] = new OutputPort(Pins.GPIO_PIN_D3, false); leds[2] = new OutputPort(Pins.GPIO_PIN_D4, false); leds[3] = new OutputPort(Pins.GPIO_PIN_D7, false); leds[4] = new OutputPort(Pins.GPIO_PIN_D8, false); leds[5] = new OutputPort(Pins.GPIO_PIN_D10, false); leds[6] = new OutputPort(Pins.GPIO_PIN_D11, false); leds[7] = new OutputPort(Pins.GPIO_PIN_D12, false); leds[8] = new OutputPort(Pins.GPIO_PIN_D13, false); leds[9] = new OutputPort(Pins.GPIO_PIN_A0, false); while (true) { for (int i = 0; i < leds.Length; i++) { leds[i].Write(true); if (i % 2 == 1) { red.SetDutyCycle(100); red.SetDutyCycle(0); } else { green.SetDutyCycle(100); green.SetDutyCycle(0); } leds[i].Write(false); } } }
What's the easiest way to accomplish this? (10 RGB LEDs, on simultaneously, each with its own PWM values for red, green and blue)
What about using two of these?
Thanks!