Shop OBEX P1 Docs P2 Docs Learn Events
matlab — Parallax Forums

matlab

greengreen Posts: 6
edited 2004-07-31 00:14 in BASIC Stamp
How do you get matlab to send signals from a PC to a 2p40 through serial communication? I used serin in the 2p40 and fwrite in matlab (like I use·49 for·1 [noparse][[/noparse]49 is ASCII for 1]) and I can't get it to work...

Post Edited By Moderator (sswanson) : 7/30/2004 1:21:32 PM GMT

Comments

  • dandreaedandreae Posts: 1,375
    edited 2004-07-30 22:36
    Hello,



    I was just at www.google.com and I typed in "Matlab and the BASIC Stamps" and have found all kinds of information related to this subject.· I hope this helps.

    Regards,

    Dave
  • greengreen Posts: 6
    edited 2004-07-31 00:14
    Thanks. I got the answer. I also used google previously but the responses were not helpful (but could be different for others.) For those interested; you use the "fwrite" command and add 48 to the number (to make it ASCII). The character type depends on application but I used uint8. Store the data to be transfered into a variable-array. You may can use "fprintf" command to by-pass the addition of 48 to every index in the numeric array; but I did not experiement with that.
Sign In or Register to comment.