Smart Home Automation Forum
[Arduino IDE demo source code for KC868-AG]--#02 433Mhz receive code - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20)
+--- Forum: KC868-AG / AG Pro / AG8 (https://www.kincony.com/forum/forumdisplay.php?fid=30)
+--- Thread: [Arduino IDE demo source code for KC868-AG]--#02 433Mhz receive code (/showthread.php?tid=1674)



[Arduino IDE demo source code for KC868-AG]--#02 433Mhz receive code - KinCony Support - 01-27-2022

Code 2: //The demo code is 433Mhz receive code   You can copy the code to your Arduino IDE

Code:
#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(digitalPinToInterrupt(13));// IO13  433 RECEIVE PIN
}

void loop() {
  if (mySwitch.available()) {
   
    Serial.print("Received ");
    Serial.print( mySwitch.getReceivedValue() );
    Serial.print(" / ");
    Serial.print( mySwitch.getReceivedBitlength() );
    Serial.print("bit ");
    Serial.print("Protocol: ");
    Serial.println( mySwitch.getReceivedProtocol() );

    mySwitch.resetAvailable();
  }
}
   
.zip   RF-receiver.zip (Size: 393 bytes / Downloads: 261)