Serial communication
cclaud2
Posts: 21
Is it possible to send multiple variables at once through serout and receive those variables by serin?
"Sender"
SEROUT SO\FC, Baud, [noparse][[/noparse]dec tempS, dec pressureS] ' send multiple variables?
"Receiver"
SERIN SI\FC, Baud, [noparse][[/noparse]dec tempR, dec pressureR] ' receive·multiple variables?
-Or how would you do this?· Any help would be greatly appreciated.
·
"Sender"
SEROUT SO\FC, Baud, [noparse][[/noparse]dec tempS, dec pressureS] ' send multiple variables?
"Receiver"
SERIN SI\FC, Baud, [noparse][[/noparse]dec tempR, dec pressureR] ' receive·multiple variables?
-Or how would you do this?· Any help would be greatly appreciated.
·
Comments
SEROUT So\Fc, Baud, [noparse][[/noparse]DEC tempS, ",", DEC pressureS]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
SEROUT So\Fc, Baud, [noparse][[/noparse]DEC tempS, ",", DEC pressureS]
SERIN So\Fc, Baud, [noparse][[/noparse]DEC tempS,·",", DEC pressureS]· '<-- I cannot receive·
············································································· the·variables
·
serin......[noparse][[/noparse]temp, press]
The Stamp would receive two bytes from the serout statement, receive the data and store what i received in temp and press.· You can then debug:
debug dec ? temp, cr
debug dec ? press, cr
OK?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
· SEROUT So\Fc, Baud, [noparse][[/noparse]DEC tempS, ",", DEC pressureS, ","]
... and it will work -- sorry, I left the delimiter off the second variable and this is required since you're moving data between the two devices as text.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
I have these six SEROUT text statements (see below) that I need to send to a PINK module when an event occurs. A simple webpage links to the PINK variables to fill certain table cells. I am monitoring 16 conditions in and around my home so all of this is multiplied by 16 and is taking up way too much space.
They do work individually, but I want to combine SEROUT variables to minimize the code size.
I tried to combine three of them onto one line like this:
SEROUT TX, BAUD, ["!NB0W20:OPEN", "!NB0W21:", "!NB0W60:DATE and TIME", CLS]
That just resulted in the cell displaying this
OPEN!
NB0W21:!
NB0W60:DATE
and TIME
Not what I want.
This thread mentions placing "." delimiters between actual variables, whereas I am sending text "strings". Would this apply to the text as well?
falcon