User manual

Inside the loop the send command would then be:
Some protocols such as NEC always use the same number of bits and so you do not need to
specify as an additional parameter. See the prototypes in IRLib.h and the users manual to see if the
extra bits parameter is required.
Sending and Receiving in the Same Program
There are special considerations when doing sending and receiving in the same program. Both
sending and receiving make use of the building hardware timers. However the timer is used for two
different purposes. When you send a code, it reconfigures the timer and disables receiving. So you
have to reenable your receiver after each send. For example:
Normally you would only need to call My_Receiver.enableIRIn(); once in the setup routine but if
you are both sending and receiving you have to call it after each send.
For a complete example of how to send and receive in the same program, look at the IRrecord.ino
sample sketch in the examples folder. When you load the sketch, open your serial monitor, point a
remote at the receiver and push a button. The program will capture that code. Then every time the
type of character into the serial monitor it will repeat that code through the LED.
IRsendSony My_Sender;
My_Sender.send(0xa8bca, 20);
My_Sender.send(Protocol, Data, Bits);
My_Receiver.enableIRIn(); // Re-enable receiver
© Adafruit Industries https://learn.adafruit.com/using-an-infrared-library Page 22 of 23