I'm trying to set up the simplest IrRemote code through youtube and websites examples, although the new libraries available don't work with the online examples. I've downloaded the latest library off GitHub and the SimpleReceiver example is overwhelming... I cannot understand the code.
It is very different from the online demonstrations available.
Does anyone know of a simple code example that simply gets the IR sign and prints it out on the serial monitor?
#include <IRremote.hpp>
#define IR_RECEIVE_PIN 2
void setup()
{
Serial.begin(115200); // // Establish serial communication
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK); // Start the receiver
}
void loop() {
if (IrReceiver.decode()) {
Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX); // Print "old" raw data
IrReceiver.printIRResultShort(&Serial); // Print complete received data in one line
IrReceiver.printIRSendUsage(&Serial); // Print the statement required to send this data
...
IrReceiver.resume(); // Enable receiving of the next value
}
}