//https://roboticsbackend.com/arduino-ir-remote-controller-tutorial-setup-and-map-buttons/
//Read data from the IR remote controller
#include <IRremote.h>
#define IR_RECEIVE_PIN 8
void setup() {
Serial.begin(9600);
IrReceiver.begin(IR_RECEIVE_PIN);
}
void loop() {
if (IrReceiver.decode()) {
//If yes, we immediately call IrReceiver.resume() so that the sensor will continue to read data
IrReceiver.resume();
Serial.println(IrReceiver.decodedIRData.command);
}
}