Arduino erros using Matlab. (Use Matlab like Monitor Serial)

2 次查看(过去 30 天)
Hi, I trying to control one Arduino system and read their output data, just like the monitor serial from the Arduino IDE. I read a little about it, but I only find how to set some outputs signals and/or read some digital outputs. I trying something but it always comes to this message and I can only read the first message that would come in the serial monitor. 'Warning: Unsuccessful read: A timeout occurred before the Terminator was reached..'
s = serial('COM11')
set(s,'BaudRate', 115200)
fopen(s)
out = fscanf(s)
z=1;
while (z==1)
dat = fscanf(s);
fwrite(s,1);
fscanf(s);
end
It's one way that the Matlab works like the serial monitor, I mean, that I can read e write information instantly? I like to use Matlab because sometimes I would like to use some loops and it would be impossible to do automatic in serial monitor from Arduino IDE.
Thanks, everybody.
  4 个评论

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Support Package for Arduino Hardware 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by