Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Arduino IDE demo source code for KC868-SERVER]--#02-IR_RECEIVE code
#1
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();
    }
}
           
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)