Serial data between BS2's
ee95816
Posts: 1
I am pretty new at using these things, and so far things have worked out as expected.··But I am having trouble sending·a single character from one BS2 to another serially.· I am using·SEROUT to send the data and SERIN to receive the data.· All I get on the reciveing end is gibberish.· The code looks to be fairly simple based on the help files, but I am getting nowhere.· Below is my code, can anybody alleviate my ignorance?
thanks in advance
Sending Unit
' {$STAMP BS2}
' {$PBASIC 2.5}
· SEROUT 1, 16780, [noparse][[/noparse]"H"]
Reciveing Unit
' {$STAMP BS2}
' {$PBASIC 2.5}
sData VAR Byte
SERIN 1, 16780, [noparse][[/noparse]sData]
DEBUG DEC sData
thanks in advance
Sending Unit
' {$STAMP BS2}
' {$PBASIC 2.5}
· SEROUT 1, 16780, [noparse][[/noparse]"H"]
Reciveing Unit
' {$STAMP BS2}
' {$PBASIC 2.5}
sData VAR Byte
SERIN 1, 16780, [noparse][[/noparse]sData]
DEBUG DEC sData
Comments
If you want to see an H in DEBUG, then that line should be:
DEBUG sData
' {$STAMP BS2}
' {$PBASIC 2.5}
sData VAR Byte
sData = $FF
Retry:
SERIN 1, 16780, [noparse][[/noparse]sData]
If sData = $FF THEN Retry
DEBUG sData
END
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
The tx line from one stamp has to go to the rx line of the other!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."