05-10-2024, 10:25 AM
(This post was last modified: 05-10-2024, 10:29 AM by franco.demei@gmail.com.)
(05-10-2024, 03:21 AM)admin Wrote: you need use two board, one for send , another for receive.
maybe your code send RF and receive RF signal can't at the same time.
As do you can see on the oscilloscope picture trasmitted signal and received signal are in the same fase. Anyway with the code below (I enabled only the receiver) pressing one button to the remote control, On U8 Pin 4 (strigth connected with IO19) We can see received signal very cleaned (see picture in attacment.) But there is not output to the serial monitor.
Code:
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
mySwitch.enableReceive(digitalPinToInterrupt(19)); //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();
}
}