I have a rf receiver RWS 371-6 and the transmitter for this component and i can`t receive. I tried with VirtualWire(outdated i think), Radiohead and RCSswitch libraries, and no one of them could work for me. i have used the examples of every library i couldn't make it work
i've been searching for a week or so and i could find anything so i'm doing my best to write this because i don't talk too much in english
with this code at least i can receive something(all of the inputs are 0 so i didn't work anyway)
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
mySwitch.enableReceive(0); // Receiver on interrupt 0 => that is pin #2
}void loop() {
Serial.print("Received ");
Serial.print( mySwitch.getReceivedValue() );
Serial.print(" / ");
Serial.print( mySwitch.getReceivedBitlength() );
Serial.print("bit ");
Serial.print("Protocol: ");
Serial.println( mySwitch.getReceivedProtocol() );
}
this is the transmitter code in PIC:
include "modedefs.bas"
inicio:
//main
botona var portb.0
botonb var portb.3
high portb.5
pause 1000low portb.5
pause 1000high portb.6
pause 1000low portb.6
pause 1000proceso:
//an artificial loop if you look at the others functions
if botona = 0 then goto aaa
if botonb = 0 then goto bbb
serout portb.2,n2400,[$FF,$FF,"OK","C"]
gosub led
goto procesoaaa:
serout portb.2,n2400,[$FF,$FF,"OK","A"]
gosub led1
goto procesobbb:
serout portb.2,n2400,[$FF,$FF,"OK","B"]
gosub led2
goto proceso
edit: the processes led, led1 and led2, only turn some leds on and off