User manual

IR Receiver Selection Guide from
Vishay (PDF format)
http://adafru.it/ezb
More information on receivers as well as schematics for using multiple receivers can be found in the
IRLib manual section 1.4.3.
Decoding IR Data
Load the following sketch. It is a slightly modified version of "IRecvDump" sketch from the examples
folder of the library.
After the sketch has loaded, open your serial monitor and make sure it is set to 9600 baud. Aim
your IR remote at the receiver and press a button. In this example we press the "Play/Pause" button
on the Adafruit Mini Remote. The results were as follows:
Decoded NEC(1): Value:FD807F (32 bits)
Raw samples(68): Gap:40826
Head: m8850 s4450
#include <IRLib.h>
//Create a receiver object to listen on pin 11
IRrecv My_Receiver(11);
//Create a decoder object
IRdecode My_Decoder;
void setup()
{
Serial.begin(9600);
My_Receiver.enableIRIn(); // Start the receiver
}
void loop() {
//Continuously look for results. When you have them pass them to the decoder
if (My_Receiver.GetResults(&My_Decoder)) {
My_Decoder.decode(); //Decode the data
My_Decoder.DumpResults(); //Show the results on serial monitor
My_Receiver.resume(); //Restart the receiver
}
}
© Adafruit Industries https://learn.adafruit.com/using-an-infrared-library Page 7 of 23