Shop OBEX P1 Docs P2 Docs Learn Events
serial communication — Parallax Forums

serial communication

panagiotispanagiotis Posts: 14
edited 2006-02-13 18:26 in BASIC Stamp
Hello i would like to ask a question about the communication with matlab.
i know how to send from matlab the following sequence: pos:a500b600c800
What i do not know is how to extract·the numbers 500 then 600 and 800 to save them·in three desired variables e.g. a, b ,c·in order to move·3 servos..
I tried the following code but i didn't work.
.
.
.

SERIN serial,baud,[noparse][[/noparse]WAIT("pos:a"),DEC3 a, WAIT("b"), DEC3 b, WAIT("c"), DEC3 c ]
.
.
.
does anyone know what i do wrong
thanks.

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-02-13 18:26
    panagiotis -

    Try this:

    SERIN serial,baud, [noparse][[/noparse]WAIT("pos:a"), DEC3 a, SKIP 1, DEC3 b, SKIP 1, DEC3 c]

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
Sign In or Register to comment.