01-05-2022, 06:28 AM
(This post was last modified: 01-05-2022, 07:36 AM by KinCony Support.)
Code 1: //The demo code is RF-receive You can copy the code to your Arduino IDE
Code:
#include <RCSwitch.h> //Install library "rcswitch"
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
mySwitch.enableReceive(digitalPinToInterrupt(15)); //receive PIN IO15
}
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();
}
}