01-27-2022, 01:36 AM
(This post was last modified: 01-27-2022, 02:09 AM by KinCony Support.)
Code 2: //The demo code is 433Mhz receive code You can copy the code to your Arduino IDE
RF-receiver.zip (Size: 393 bytes / Downloads: 260)
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();
}
}
RF-receiver.zip (Size: 393 bytes / Downloads: 260)