RF basic stamp link communication problem
MLunsfo
Posts: 2
I am attempting to turn on two led's remotely using an rf link between a bs1 and a bs2. I am using an RWS 434 receiver with my bs1 and a TWS 434 transmitter with my bs2. The transmitter and receiver use A.M. and operate at 434 MHZ. The transmitter receives·a transmit command·via an RS232 serial connection and a visual basic·program.··So basically, my setup is seen below:
VB-->rs232-->bs2-->tws434-->rws434-->bs1-->led's
The problem is that the·led's·are·energizing on their own even when I am not transmitting anything.·What can i do to prevent this?··I have attached my·code for the bs1, bs2 and vb.·Any information would be greatly appreciated.
VB-->rs232-->bs2-->tws434-->rws434-->bs1-->led's
The problem is that the·led's·are·energizing on their own even when I am not transmitting anything.·What can i do to prevent this?··I have attached my·code for the bs1, bs2 and vb.·Any information would be greatly appreciated.
Comments
The following thread may help you out. Andy Lindsay has posted some code using CRC checksum to prevent errors from interfering with your transmission. I hope this helps. Take care.
http://forums.parallax.com/showthread.php?p=611353
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Post Edited (Chris Savage (Parallax)) : 4/3/2007 3:35:38 PM GMT
I am trying to·light·up the appropriate led based on the data that i am sending from my transmitter that is connected to·the BS2.·I am continously sending a checksum and a·1 or a·2·to my receiver·with the serout command. The serout command·from my transmitter·code is shown below
BS2 Transmitter·Sending a 2
up:
x = x + 1
y = y + 1
z = z + 1
checksum = x + y + z
PULSOUT 15, 2000
SEROUT 15,16780,[noparse][[/noparse]junk,"ABCD",x,y,z,checksum,updat]
PAUSE 50
GOTO up
In the case above,·the updat value that is being continuously sent·to the receiver·is 2.·My serout·code for sending·a 1 is exactly the same. ·The problem is that only one of the led's connected to pin 0 or 1·will energize based on the data.·The receiver will not differientiate between·the data being sent (1 or a 2)·and·will only light up·one of the led's.·I have used the debug command to view the dat that i am receiving and it seems to be receiving the correct data, but·will not jump to the·appropriate·label. Is their an obvious explanation for·this or an error in my code? I am kinda new to serial comm so any information will be helpful.·A portion of my receiver code·is shown below: (I have attached my complete code for the transmitter and receiver)
BS1 Reciever Code
START:
SERIN 4,N2400,("ABCD"), x, y, z, sum, dat
checksum = x + y + z
IF checksum = sum AND dat = 1 THEN down
down:
HIGH 0
GOTO down
IF checksum = sum AND dat = 2 THEN up
up:
HIGH 1
GOTO up
GOTO START
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
The obvious thing to do is change the goto up/down in these loops to goto start.
IF checksum = sum AND dat = 1 THEN down
GOTO nextled
down:
HIGH 0
GOTO START
nextled:
IF checksum = sum AND dat = 2 THEN up
GOTO START
up:
HIGH 1
GOTO START