Smart Home Automation Forum
[Arduino IDE demo source code for KC868-E16S]--#01-KC868-E16S-433-decode - 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-E16S/E16P (https://www.kincony.com/forum/forumdisplay.php?fid=26)
+--- Thread: [Arduino IDE demo source code for KC868-E16S]--#01-KC868-E16S-433-decode (/showthread.php?tid=1923)



[Arduino IDE demo source code for KC868-E16S]--#01-KC868-E16S-433-decode - KinCony Support - 05-17-2022

[Arduino IDE demo source code for KC868-E16S]--#01-KC868-E16S-433-decode
   

Code:
/*www.kinocny.com */
/*KC868-E16S CODE OF 433MHz decode*/

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(digitalPinToInterrupt(4));
}

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();
  }
}