Smart Home Automation Forum

Full Version: [Arduino IDE demo source code for KC868-AG]--#04--IR receive code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code 3: //The demo code is  IR receive code   You can copy the code to your Arduino IDE

Code:
#include "PinDefinitionsAndMore.h"
#include <IRremote.h>

void setup() {

  Serial.begin(9600);
  IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN);
      //IR_RECEIVE_PIN is defined in PinDefinitionsAndMore.h file   IO23
}

void loop() {


    if (IrReceiver.decode()) {

       IrReceiver.printIRResultShort(&Serial);
        if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
            IrReceiver.printIRResultRawFormatted(&Serial, true);
        }
        Serial.println();
     IrReceiver.resume();

    }
}

[attachment=584]
[attachment=583]
GOOD