05-06-2023, 01:11 AM
[Arduino source code for KC868-A32M]-02_IR_receive_code
Code:
#include <IRremote.h>
IRrecv irrecv_16(16);// set ir_receive pin IO16
void setup() {
Serial.begin(115200);
irrecv_16.enableIRIn();
}
void loop() {
if (irrecv_16.decode()) {
if(irrecv_16.decodedIRData.decodedRawData!=(0)){
Serial.print("irCode address: ");
Serial.println(irrecv_16.decodedIRData.address,HEX);
Serial.print("irCode command: ");
Serial.println(irrecv_16.decodedIRData.command,HEX);
Serial.print("irCode decodedRawData: ");
Serial.println(irrecv_16.decodedIRData.decodedRawData,HEX);
}
IrReceiver.resume();
}
}