Smart Home Automation Forum

Full Version: [Arduino IDE demo source code for KC868-SERVER]--#03-IR_send code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
#include <IRremote.h>
IRsend irsend_23(23);      // set ir_send pin IO23
uint8_t sRepeats = 0;

void setup() {

  Serial.begin(9600);
  pinMode(0,INPUT);
  IrSender.begin(23, ENABLE_LED_FEEDBACK);
  IrSender.enableIROut(38);
}

void loop() {
  /*the raw_code of your remote button,you can get it by our
    example [Arduino IDE demo source code for KC868-SERVER]--#02-IR_RECEIVE code*/
        Serial.println("Turn on LED");
        irsend_23.sendNECRaw(0xF807FF00, sRepeats);   //  0xF807FF00  is the raw_code  of led on
        delay(1000);
        Serial.println("Turn off LED");
        irsend_23.sendNECRaw(0xF906FF00, sRepeats);  //   0xF906FF00 is the raw_code  of led Off
        delay(1000);
}
[attachment=863]
This code will turn on LED and delay 1s turn off LED
[attachment=861]
The raw_data of LED on is 0xF807FF00  ,you can decode the data by our example code
"[Arduino IDE demo source code for KC868-SERVER]--#02-IR_RECEIVE code"
[attachment=864]