serial communication with matlab
Gayatri318
Posts: 2
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.
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
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.