RF Transmitters/Receivers
I purchased 2 transmitters and 1 receiver to make a simple remote system (push button, machine turns on). No problem with 1 transmitter 1 receiver, worked fine on bench. When I introduced the 2 transmitter, I found out I had a problem. I suppose 2 transmitters can't pulse and ser at the same time. Can I get some ideas on how to solve my issue?
Comments
There are other solutions, but they're more complex and you couldn't do it with what you currently have.
Silly me, thought that both xmtr's could have the same logic and the rcvr would listen to either one of them. One xmtr and rcvr set work great. As soon as I apply power to second xmtr, that's when things get real iffy on who the rcvr is going to listen to.
My question is; is there a way to program this to use 2 xmtr's and 1 rcvr?
I am embarrassed on the program, but, here it is.
' TxCode_v_1.0.bs1
'{$STAMP BS1}
'{$PBASIC 1.0}
'
'Parallax 433.92 MHz RF Transmitter (#27980) Sample Tx Code (BS1)
'Connect I/O Pin 1 of the BS1 to the DATA line on the RF module
'Connect +5v (Vdd) to the 5v line, connect Ground (Vss) to the GND line
'Note the PULSOUT instruction: this helps the receiver sync with
'the transmitter, especially after lapses in communication.
'This code transmits at 2400 baud
SYMBOL x =PIN5
SYMBOL y = PIN4
DIRS = %00100000
Start:
PULSOUT 0, 300 'Sync pulse for the receiver
x = 1
SEROUT 0, N2400, ("HEY", PIN5)
'SEROUT 0, N2400, ("YOU", PIN5)
IF y = 0 THEN start2
GOTO start
Start2:
PULSOUT 0, 300 'Sync pulse for the receiver
x = 0
SEROUT 0, N2400, ("HEY", PIN5)
'SEROUT 0, N2400, ("YOU", PIN5)
IF y = 1 THEN start
GOTO start2
+++++++++++++++++++++++++++++++++++
'RxCode_v_1.0.bs1
'{$STAMP BS1}
'{$PBASIC 1.0}
SYMBOL x = PIN5
SYMBOL y = PIN4
OUTPUT 5
INPUT 4
Start:
· SERIN 0, N2400, ("HEY"), PIN5
· 'SERIN 0, N2400, ("YOU"), PIN5
GOTO Start