Smart Home Automation Forum
[Arduino source code for KC868-1U]-03_IR_receive_code - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20)
+--- Forum: KC868-1U (https://www.kincony.com/forum/forumdisplay.php?fid=52)
+--- Thread: [Arduino source code for KC868-1U]-03_IR_receive_code (/showthread.php?tid=3006)



[Arduino source code for KC868-1U]-03_IR_receive_code - KinCony Support - 06-21-2023

[Arduino source code for KC868-1U]-03_IR_receive_code
Code:
/*KC868-1U IR receive code*/
#include <IRremote.h>
IRrecv irrecv (15);
void setup() {

  Serial.begin(115200);
  irrecv.enableIRIn();
}

void loop() {
    if (irrecv.decode()) {
      Serial.print("irCode address: ");           
        Serial.println(irrecv.decodedIRData.address,HEX);
        Serial.print("irCode command: ");           
        Serial.println(irrecv.decodedIRData.command,HEX);
        Serial.print("irCode decodedRawData: ");           
        Serial.println(irrecv.decodedIRData.decodedRawData,HEX);
        Serial.println();
        //delay(1000);
    }
      IrReceiver.resume();
}