Quote Originally Posted by Etcho View Post
Thanks for all the help - I will look into doing it with PWM - The crystal I plan on using is 20MHZ (just to make sure - the crystals decoupling? caps should be around 22pf right?)

One other thing which may be a tad off topic -

I know I should go off the data sheet of the IR LEDs but I was wondering if either of you knew if the PIC would be strong enough to drive two IR LEDs in series or if they should be driven separately - one on each PWM pin or if I would need to use a transistor to drive them. The maximum current the PIC is supposed to source/sink per pin is 25mA but I was curious as to if it would be enough.

I am not looking to have it pick up obstacles at a real long range maybe 3 - 6 inches tops.

Thanks again for the help

edit: thanks for the links mister e
What's the forward voltage drop of the IR LEDs? If it's less than 2.5v each, yes, you can drive 2 in series. If it's less than 1.6v, you can drive 3 in series. However, total output will probably drop a bit. You might want to drive the gate of a MOSFET which in turn will drive the IR LEDs.