04-21-2022, 06:16 AM
(This post was last modified: 04-22-2022, 01:18 AM by KinCony Support.)
Code:
#include <IRremote.h>
IRrecv irrecv_22(22);// set ir_receive pin IO22
void setup() {
Serial.begin(9600);
irrecv_22.enableIRIn();
}
void loop() {
if (irrecv_22.decode()) {
if(irrecv_22.decodedIRData.decodedRawData!=(0)){
Serial.print("irCode address: ");
Serial.println(irrecv_22.decodedIRData.address,HEX);
Serial.print("irCode command: ");
Serial.println(irrecv_22.decodedIRData.command,HEX);
Serial.print("irCode decodedRawData: ");
Serial.println(irrecv_22.decodedIRData.decodedRawData,HEX);
}
IrReceiver.resume();
}
}