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

serial communication with matlab

Gayatri318Gayatri318 Posts: 2
edited 2006-04-22 00:25 in BASIC Stamp
hi,
I am trying to send (and receive) numeric constants from matlab to basic stamp(am using BS2p 40). Iam creating the serial port object in matlab,writing the value in it and closing the object .After which,I run my basic stamp program and use the command(after the initialization of the variables)---

SERIN 16,84,2000,Nodata,[noparse][[/noparse]DEC y]

FOR iter = 1 TO y
HIGH red
PAUSE 200
LOW red
PAUSE 200
NEXT

Nodata:
DEBUG CLS, "timed out"
GOTO en

where if y is, say 5 then I have my red light glowing 5 times. This 5 was written earlier in my matlab serial port object.
Everytime i do this process,I always get a "timed out" output at the debug terminal....even on increasing the 'timeout' delay.

what would be the efficient way of sending/receiving constants from stamp to matlab?

please suggest.


thanks
Gayatri.

Comments

  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-04-22 00:25
    If you are using a BS2P <--- Note the P, double check your baudmode value setting in the SERIN statement.

    If you look at the PBasic IDE help section, you'll notice that you need to use the charts with the yellow square above the chart. Your value of 84 in SERIN 16,84,2000,Nodata,[noparse][[/noparse]DEC y] is probably causing a connection error.
Sign In or Register to comment.