C++ class for the infrared remote control and reciever module
#include "Arduino.h"
#include "IR.h"
#define IR_PIN 34
IR ir(IR_PIN); // do not change the objectname, it must be "ir"
//--------------------------------------------------------------
void setup()
{
ir.begin(); // Init InfraredDecoder
Serial.begin(115200);
}
void loop()
{
ir.loop();
// do something else
// ...
}
//--------------------------------------------------------------
// events called from IR Library
//--------------------------------------------------------------
void ir_res(uint32_t res){
Serial.print("ir_res: ");
Serial.println(res);
}
void ir_number(const char* num){
Serial.print("ir_number: ");
Serial.println(num);
}
void ir_key(const char* key){
Serial.print("ir_key: ");
Serial.println(key);
}