// read ir codes from remote for motor boat nov30-23
#include <IRremote.hpp>
#define IR_RECEIVE_PIN 2
void setup() {
Serial.begin(9600);
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK); // Start the receiver
}
void loop() {
if (IrReceiver.decode()) {
Serial.println(IrReceiver.decodedIRData.command, HEX);
IrReceiver.printIRResultShort(&Serial);
switch (IrReceiver.decodedIRData.command) {
case 0x68: Serial.println("0"); break;
case 0x30: Serial.println("1"); break;
case 0x18: Serial.println("2"); break;
case 0x7A: Serial.println("3"); break;
case 0x10: Serial.println("4"); break;
case 0x38: Serial.println("5"); break;
case 0x5A: Serial.println("6"); break;
case 0x42: Serial.println("7"); break;
case 0x4A: Serial.println("8"); break;
case 0x52: Serial.println("9"); break;
}
IrReceiver.resume(); // Enable receiving of the next value
}
}