#include <IRremote.hpp>
#define IR_RECEIVE_PIN 4
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud rate
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK); // Start the receiver
}
void loop() {
if (IrReceiver.decode()) {
// Print the raw data in hexadecimal format
Serial.print("Raw data: 0x");
Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX);
// Print a short summary of the received IR data
IrReceiver.printIRResultShort(&Serial);
// Print the statement required to send this data
IrReceiver.printIRSendUsage(&Serial);
// Enable receiving of the next value
IrReceiver.resume();
}
}