serial communication
panagiotis
Posts: 14
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.
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
Try this:
SERIN serial,baud, [noparse][[/noparse]WAIT("pos:a"), DEC3 a, SKIP 1, DEC3 b, SKIP 1, DEC3 c]
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->