You should put a resistor inline with the LED; if that pin is made high without modulation you'll pop the IR Led or the pin. I've attached a program that may work for you -- I wrote it for someone else and haven't had the time to test it myself. You'll also have to change the IR Led connections as this program uses one pin for modulation and another pin for on/off control.
Change the FREQ directive to 4_000_000 -- the rest of the program should work just fine.
You'll need to look-up the codes for the kind of device that you want to emulate. Use Google to research SIRCS and you'll find lists of codes (the program sends a 12-bit [noparse][[/noparse]device + command] code for each key) that correspond to popular devices like TVs, VCRs, etc.
You must update the program. The demo in the help file (I wrote it) decodes an SIRCS signal and displays the 12-bit code on the LEDs. You're program will have to receive a code, decode it, and then decide how to manipulate an I/O port.
Comments
You'll need to look-up the codes for the kind of device that you want to emulate. Use Google to research SIRCS and you'll find lists of codes (the program sends a 12-bit [noparse][[/noparse]device + command] code for each key) that correspond to popular devices like TVs, VCRs, etc.
2) if i want to turn off led at rb.0, what data i must send from my remote....