Something like this might get you started, your string is "t=12 b=222 r=12 st=05000 sp=10000"
t var byte
b var byte
r var byte
st var word
buffer var byte[18] 'array variable to hold incoming string
serin 1,n2400,[STR buffer\18] 'get 18 bytes, store in buffer (I'm assuming that the
'quotation marks are part of the string.)
t = buffer[3]
b = buffer[7]
r = buffer[11]
st.highbyte = buffer[16]
st.lowbyte = buffer[17]
Ok, so now you have your string in the buffer. To parse it out you can get at the individual bytes like so; buffer[0] holds the ", buffer[1] holds the letter t (actually it holds the ascii value, 116, buffer[2] holds the equal sign, ascii 61, buffer[3] holds (hopefully,) the variable, which in your example string is 12. Buffer[7] holds the variable 222, etc. I haven't used serin, I always use hserin, and I can't lay my hands on a Picbasic manual to check the syntax, but I think you get idea. You can do something like lcdout $fe,1,"t= ",dec buffer[3] if you have an lcd connected to see the variable, in case I counted wrong.
Good Luck,
Jerry.
Bookmarks