Quote Originally Posted by Forkosh View Post
What is the code I can use to modulate IR

I am using an IR LED and IR phototransistor to detect a line

How can I modulate that?


I am using the PIC 16F616 @ 4mhz

Thank You
Use the HPWM to generate the modulation; change the status of the HPWM pin to an output when you want a '1' to be transmitted, and change it to an input for a '0'. This way, you can achieve the IR transmission with only 1 pin, and no external gating circuitry.

BTW, if you are modulating the IR signal, you'd get much better results using a 3 pin IR demod. module.

Regards,

Anand Dhuru