Hi,
I am simply trying to use the example for the RC-switch library with the ZW3102 receiver.
the code is posted below.
I am getting no response on the serial monitor at all.
If I define a digital pin as an input (int or bool), and print that pin (with the ZW's data line connected to it) at the beginning of the loop, I get random 1's and 0's until I press the key fob - at which point I receive full 0's or 1's dependant on the key pressed. which I assume is proof of RX from the ZW?
Any idea why the decoding side of things is not picking up on the TX from the fob?
Thanks in advance!
Dan
The library link is:
The tutorial I'm following is:
The ZW3102 + data:
https://www.jaycar.com.au/medias/sys_master/images/8978447269918/ZW3102-dataSheetMain.pdf
The code I am running is:
/*
Simple example for receiving
*/
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
mySwitch.enableReceive(0); // Receiver on interrupt 0 => that is pin #2
}
void loop() {
if (mySwitch.available()) {
int value = mySwitch.getReceivedValue();
if (value == 0) {
Serial.print("Unknown encoding");
} else {
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();
}
}