Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Arduino demo source code for KC868-A4]-03 send 433MHz RF signal
#1
Heart 
Code 2: //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(21);  // IO21
  }

void loop() {

  /* See Example: TypeA_WithDIPSwitches */
  mySwitch.switchOn("11111", "00010");
  delay(1000);
  mySwitch.switchOff("11111", "00010");
  delay(1000);

  /* Same switch as above, but using decimal code */
  mySwitch.send(5393, 24);
  delay(1000); 
  mySwitch.send(5396, 24);
  delay(1000); 

  /* Same switch as above, but using binary code */
  mySwitch.send("000000000001010100010001");
  delay(1000); 
  mySwitch.send("000000000001010100010100");
  delay(1000);

  /* Same switch as above, but tri-state code */
  mySwitch.sendTriState("00000FFF0F0F");
  delay(1000); 
  mySwitch.sendTriState("00000FFF0FF0");
  delay(1000);

  delay(20000);
}
   
Reply


Messages In This Thread
[Arduino demo source code for KC868-A4]-03 send 433MHz RF signal - by KinCony Support - 01-07-2022, 02:18 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)