not sure what language you use, but here's my working solution (a recent project) in BoostC.
essentially it's a 2-channel RGB LED controller, where either channel either accepts a color value via serial (0-255, fades from red to green to blue, with of course all colors in between), or shows a fixed color chosen by holding down a button.
Code:
void PWM_cycle()
{
char a;
RLED1=0; GLED1=0; BLED1=0;
RLED2=0; GLED2=0; BLED2=0;
for(a=0; a<255; a++)
{
if(a>=r1val)
{ RLED1 = 1; }
if(a>=g1val)
{ GLED1 = 1; }
if(a>=b1val)
{ BLED1 = 1; }
if(a>=r2val)
{ RLED2 = 1; }
if(a>=g2val)
{ GLED2 = 1; }
if(a>=b2val)
{ BLED2 = 1; }
delay_10us(5);
}
checkserial();
}
that's my entire PWM routine. (note i was using common anode LEDs so 0=on, 1=off) calculating the values for the **val variables is a separate task, not difficult, but unimportant for getting the PWM working... but really, the PWM function is extremely simple, you should definitely try to get it working. even if you're not using C, it should be fairly obvious what's going on there, and not very hard to replicate it in whatever language. the one disadvantage is that it does require the PIC to spend most of its time running the routine to generate the PWM.
trying to do it with multiple resistors is going to require tons of I/O just to control one LED. if your application makes it impossible to be constantly running a routine to generate PWM cycles, then perhaps you should program a second PIC to handle that, and send it the desired color via serial... you know, exactly like what I made :lol: