I'm pretty happy with the little Six LED system that uses IR remote. I can change the patterns with any TV remote.
I'm able to do dimming of the LEDs using the following code:
analogWrite(led[3], i);
Problem is it was only working with some of the LEDs. I had the LEDs connected to pins 8 through 13 and it was working on 9, 10, 11. I noticed they are marked with PWM.
Pin 3, 5, 6 were also marked as PWM. So I tried wiring to 3,5,6, 9, 10, 11 for my six LEDs. It still doesn't dim for all.
Note, that depending on what other libraries you use, it can disable PWM on certain pins. This is due to the libraries using the hardware timer that the PWM pins use behind the scenes.
On the Uno, I believe pins 3 and 11 cannot do PWM if you use the tone library. I believe the IRRemote library also disables PWM on 3 and 11, which may be your problem. If you use the servo library, it disables PWM on pins 9 and 10. That leaves only pins 5/6 as PWM if you use both Tone/IRRemote and servo.
@Crossroads, thanks for the note. I have this at the beginning of my program...
#include <IRremote.h>
int RECV_PIN = 4;
IRrecv irrecv(RECV_PIN);
decode_results results;
//visualization
int led[] = {3,5,6,9,10,11}; //pins 9, 10, 11 can fade
int ledN = 5;
@Michael, thanks, I am using the IR. So if you're right, I then only have 4 of the six PWMs available. I can live with that for now I guess. I will only do dimming on the rest for now.
I noticed when I try and do it on some of the pins everything goes a little haywire. I suppose that's normal...
I'm making another version with an ultrasonic range finder, I suppose I'll loose some PWM pins there as well. I suppose I could try a sensor thats really simple so I can keep all six.
Note, I've bought these but so far they are on my do it someday pile.
There are chips that move the processing of the IR receiver off of the Arduino, so that all you have to do is read a single pin, and you don't have to do the timing in the Arduino via IRremote. Sparkfun sells the sis-2 that allows you to program 2 buttons (I bought this but then got busy doing other things and I haven't used it): Programmable IR Receiver - SIS-2 - SEN-08753 - SparkFun Electronics
Can add simple shift register such as Tpic6B595 to sink current thru the LEDs, then use a single PWM on its output enable pin to control dimming.
Put a 0.1uF cap from its Vcc pin to gnd.