433 Mhz Wireless Serial
posterboy
Posts: 3
Hello,
I am new to wireless serial programming. I am currently trying to connect a robot to a base station of sorts by using RF digital's 433Mhz Wireless serial transcievers. I have consulted both the provided data sheet, and the Basic stamp command refrence, yet I can not seem to find the correct baud mode setting. As of now I have had no luck getting anything close to communication between my two stamps (bs2p24, and bs2p40) Can you please look over my source code (for one way communication only), and tell me what I am doing wrong?
Thanks
SourceCode:
For Recieving:
baud VAR WORD
baud = 1021
INPUT 10
stuf VAR BYTE
DEBUG "go"
REc:
SERIN 10,baud,[noparse][[/noparse]stuf]
DEBUG DEC stuf
PAUSE 20
GOTO Rec
For Transmitting:
LOW 10
PAUSE 1000
trans:
SEROUT 14,baud, [noparse][[/noparse]DEC 1]
PAUSE 1000
GOTO trans
submit1=Submit Form
I am new to wireless serial programming. I am currently trying to connect a robot to a base station of sorts by using RF digital's 433Mhz Wireless serial transcievers. I have consulted both the provided data sheet, and the Basic stamp command refrence, yet I can not seem to find the correct baud mode setting. As of now I have had no luck getting anything close to communication between my two stamps (bs2p24, and bs2p40) Can you please look over my source code (for one way communication only), and tell me what I am doing wrong?
Thanks
SourceCode:
For Recieving:
baud VAR WORD
baud = 1021
INPUT 10
stuf VAR BYTE
DEBUG "go"
REc:
SERIN 10,baud,[noparse][[/noparse]stuf]
DEBUG DEC stuf
PAUSE 20
GOTO Rec
For Transmitting:
LOW 10
PAUSE 1000
trans:
SEROUT 14,baud, [noparse][[/noparse]DEC 1]
PAUSE 1000
GOTO trans
submit1=Submit Form
Comments
is it all wired properly
your code was a little messy sort of a mix between bs1 and bs2. you should really check out the PBasic help file or the Basic stamp manual.
http://www.parallax.com/dl/docs/prod/stamps/basicstampman.pdf
try something like this:
baud·con 1021
stuf VAR BYTE
DEBUG "go"
REc:
SERIN 10,baud,500,REc,[noparse][[/noparse]stuf] ' this will after a 500ms delay if nothing is received go back to REc
DEBUG ?·stuf
PAUSE 20
GOTO REc
trans:
SEROUT 14,baud, [noparse][[/noparse]"1"] 'if you were only trying to send a 1 else you may want to use a variable
PAUSE 1000
GOTO trans
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
DTQ
kelvin
and post your code
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
DTQ
Hope this helps--Fred
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
kelvin
I tried to connect thee two stamps using only a wire instead of the wirelesss module, however, the recieving stamp (Bs2p24) still only reports "0" as the incoming serial data even though "1" is being transmitted. I tried connecting a LED to the line, and it blinks brightly when the transmitter is transmitting, however, still nothing on the stamp.
Thanks always for your help