Smart Home Automation Forum

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

Code:
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableTransmit(digitalPinToInterrupt(22)); //IO22 433Mhz send pin
}

void loop() {
  mySwitch.switchOn("11111", "00010");
  delay(1000);
  mySwitch.switchOff("11111", "00010");
  delay(1000);

  mySwitch.send(5393, 24);
  delay(1000); 
  mySwitch.send(5396, 24);
  delay(1000); 

  mySwitch.send("000000000001010100010001");
  delay(1000); 
  mySwitch.send("000000000001010100010100");
  delay(1000);

  mySwitch.sendTriState("00000FFF0F0F");
  delay(1000); 
  mySwitch.sendTriState("00000FFF0FF0");
  delay(1000);
}
[attachment=577]
[attachment=578]