05-07-2024, 10:25 AM
(05-07-2024, 12:04 AM)admin Wrote: your receiver pin define is wrong. it should be mySwitch.enableReceive(digitalPinToInterrupt(19)); //IO19
you can use this 433MHz receive arduino code for A4 board directly: https://www.kincony.com/forum/showthread.php?tid=1641
You Right, the code is with interrupt (19). I make mistache coping the code.
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();
}
}
Even with correct interrupt address (19) I don't see anything to the serial monitor
The Arduino IDE is connnected to the KC868 via USB port (com5) I suppose we use same port to monitoring the Board activity.