Another cool PIC from Microchip with 3 16bit PWM modules, anyway i've wrote a

code for RGB LEDs with a pusbutton to pass between normal colors slide to multi color strobe effect.

Source code here. Details on the bottom.



rgb test sch

In this project i used 3 NPN transistors (BC517) to drive 8 common anode LED in parallel with the LM317

voltage regulator set to 3.4V. The GREEN and BLUE voltage drop matches the regulator while the RED diode

has a SMALLER voltage drop, about 2V, so i used 8 68ohm resistors for the RED only to limit the current to:

(3.4-2V) / 68ohm =0.0205A --> 20.5mA. If you want to use more than 8 RGB led x transistor, you should use

a larger one cause the BC517 has its limits, a second advise is: if you dont see the BLUE led light you have probably

set a low voltage (check the regulator), for example with only 3V and the high voltage drop of the blue led you have

an insufficient voltage on the collector therefore no current / low current will sink.