I am experimenting with an infra red remote, sending my normal data that I usually send by radio modules, using VirtualWire, or maybe EasyTransfer later.
I am driving the base of an LED driver transistor , ( via a resistor ) with 38 Khz from a similar timer generator as Nicks ( but with one of 2 outputs for some reason dirt cheap wireless | CHEAP, FAT and OPEN ? )
The data I take from another pin ( using NewSoftSerial) to the base of the transistor with a diode chopping the 38 Khz stream.
It is working fine, and I want to try Nicks idea of reducing the duty cycle to pump the IREDs harder.
I am only sending a few bytes at a time at 2400 baud, and can afford to have 100mS gap between bursts to keep the average drive down a bit too.
I see the background 38Khz is all done in setup.
What are the implications with this if I want my remote to go into sleep mode ? ( The remote is 4.5 v battery operated )
This is my general enter sleep routine that I blatantly copied from Crossroads, with little knowledge of how it works :-
void enterSleep()
{
/* Setup pin2 as an interrupt and attach handler. */
attachInterrupt(0, pin2Interrupt, LOW);
delay(50); // need this?
set_sleep_mode(SLEEP_MODE_PWR_DOWN); // setting up for sleep ...
sleep_enable(); // setting up for sleep ...
ADCSRA &= ~(1 << ADEN);
PRR = 0xFF;
sleep_mode(); // now goes to Sleep and waits for the interrupt
//************************************************************************************
/* The program will continue from here after the interrupt. */
detachInterrupt(0); //disable interrupts while we get ready to read the keypad
PRR = 0x00;
/* First thing to do is disable sleep. */
sleep_disable();
} // end of enterSleep() function