PDA

View Full Version : SERIN hell no, it won't go



lee555
03-02-2005, 04:10 AM
I would like to send 3 or 4 values to my stamp (bs2)
sendings is not the problem, receiving is the problem
send in vb (
value1=x······· ( ASCII)
value2=190···· (0-200)
value3=195···· (0-200)
value4=116···· (0-200)
total_value as string· = value1 & value2 & ......
) ok


'-----------------------------------------------------

Main:
· SERIN 16,$4054,PAUSEit,500,PAUSEit,[DEC3 val2,DEC3 val3,DEC3 val4]

·· DEBUG Val2,Val3,Val4,":"
··· PAUSE 20
GoTo Main·· http://forums.parallax.com/images/smilies/nono.gif
'-----------------------------------------------------
Main:
· SERIN 16,$4054,PAUSEit,500,PAUSEit,[STR mVal\7,DEC3 val3]

·· DEBUG mVal(0),mVal(1),mVal(2),mVal(3),mVal(4),mVal(5),DE C val3":"
http://forums.parallax.com/images/smilies/lol.gif·····(OK !·http://forums.parallax.com/images/smilies/tongue.gif·GOOD http://forums.parallax.com/images/smilies/turn.gif· GOOD )

········ val1 = (mVal(0) mVal(1) mVal(2))
········ val2 = (mVal(3) mVal(4) mVal(5))
··· DEBUG· val1,",",val2,",",val3,":" (http://forums.parallax.com/images/smilies/jumpin.gif·hell no)
··· PAUSE 20
GoTo Main
'-----------------------------------------------------------

steve_b
03-02-2005, 04:14 AM
What are you sending from?!· A PC?· what's the baud rate and protocol you're trying to get (N81..etc..).



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·

Steve
http://members.rogers.com/steve.brady (http://members.rogers.com/steve.brady)
"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."

allanlane5
03-02-2005, 05:18 AM
Umm, if you are sending the 4 bytes mentioned, you should recieve them as:

SERIN 16, $4054, [Val1, Val2, Val3, Val4]

THEN, you can see them as:

SEROUT 16, $4054, [Val1, DEC Val2, DEC Val3, DEC Val4]

Where 'Val1' would be the "x" character, and the others would be converted into
their decimal equivalents -- Byte '190' becomes 3 string bytes "190".

This assumes you ARE sending them as bytes from your PC originally.

The "SERIN xxx,yyy,[DEC MyVal] reads a 'string' with a CR after it, converts it
to a decimal number, and puts the decimal number into MyVal.

You had the right idea, just the wrong order of implementation.

Oh, and what did you intend by "val1 = (x y z)"?· You've left out your operators, there.

Jon Williams
03-02-2005, 06:28 AM
Hmmm ... I've used VB to send data to the BASIC Stamp with great success. Have a look at this article:

http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv89.pdf

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA