05-14-2024, 01:10 AM
i have tested with these code is work well. RF 433M receiver pin : GPIO19
make sure you have installed "RC Switch" library.
if also can't work, maybe need change another 433M receiver for a testing.
this code work well:
make sure you have installed "RC Switch" library.
if also can't work, maybe need change another 433M receiver for a testing.
this code work well:
Code:
/*
Simple example for receiving
https://github.com/sui77/rc-switch/
*/
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
mySwitch.enableReceive(digitalPinToInterrupt(19));
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();
}
}