#include <IRremote.hpp>
#define IR_RECEIVE_PIN 25
void setup() {
Serial.begin(115200);
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
}
void receive_ir_data() {
if (IrReceiver.decode()) {
Serial.println("");
Serial.print(F("Decoded protocol: "));
Serial.print(getProtocolString(IrReceiver.decodedIRData.protocol));
Serial.print(F(", decoded raw data: "));
#if (__INT_WIDTH__ < 32)
Serial.print(IrReceiver.decodedIRData.decodedRawData, HEX);
#else
PrintULL::print(&Serial, IrReceiver.decodedIRData.decodedRawData, HEX);
#endif
Serial.print(F(", decoded address: "));
Serial.print(IrReceiver.decodedIRData.address, HEX);
Serial.print(F(", decoded command: "));
Serial.println(IrReceiver.decodedIRData.command, HEX);
IrReceiver.resume();
}
}
void loop() {
delay((RECORD_GAP_MICROS / 1000) + 5);
receive_ir_data();
delay(100); // Loop delay
}