05-14-2024, 04:29 PM
(This post was last modified: 05-14-2024, 04:40 PM by franco.demei@gmail.com.)
(05-14-2024, 01:10 AM)admin Wrote: 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:
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();
}
}
The Code You Used is the same to the code I'm using. I tested the code with 2 different receivers . With same waveform output, who I posted previously. For this reason I say that is the KC868-A4 get a problem, does not read the IO19