Serial Communication between arduino uno and matlab?
1 回表示 (過去 30 日間)
古いコメントを表示
I am trying to open folder('C:') with serial communication via Arduino Uno. Can anyone tell me what is the problem in code? Code am using is:
s=serial('COM4');
fopen(s);
tic
while (toc<1)
A=fscanf(s);
if ( A == '1')
winopen('C:')
end
end
fclose(s);
delete(s);
0 件のコメント
回答 (1 件)
Walter Roberson
2016 年 5 月 4 日
If you want to read one byte at a time you should use fread() instead of fscanf
A = fread(s, 1, 'char');
0 件のコメント
参考
カテゴリ
Help Center および File 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!