#include <IRremote.h>
const byte IR_RECEIVE_PIN = 8; //pin that IR receiver is attached to
void setup()
{
Serial.begin(9600);
Serial.println("IR Receive test");
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK); //start receiving data
}
void loop()
{
if (IrReceiver.decode()) //check if there was data received and decodes the data
{
//Serial.println(IrReceiver.decodedIRData.command, HEX); //print the decoded data to serial port
int button = IrReceiver.decodedIRData.command;
Serial.println(button);
IrReceiver.resume(); //Enable receiving of the next value
}
}