Smart Home Automation Forum

Full Version: [Arduino source code for KC868-A32M]-05_433_RECEIVE
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[Arduino source code for KC868-A32M]-05_433_RECEIVE
Code:
#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(115200);
  mySwitch.enableReceive(digitalPinToInterrupt(14));  //IO19
  Serial.print("begin test");
}

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