Matlab and arduino interface

I have matlab 2014b on my mac and have installed arduino I/O package. I was trying to turn on/off a led through arduino but the matlab keep on showing an error.
delete(instrfind({'Port'},{'/dev/tty.wchusbserial1420'}))
a= serial('/dev/tty.wchusbserial1420');
fopen(a);
configureDigitalPin (a,22, 'output');
writeDigitalPin(a, 22 , 1);
for i = 1:10
writeDigitalPin(a, 22, 1);
pause(0.5);
writeDigitalPin(a, 22, 0);
pause(0.5);
end
Warning: Unsuccessful read: A timeout occurred before the Terminator was reached..
Error using arduino (line 104)
Connection unsuccessful, please make sure that the board is powered on, running a sketch provided with the package, and connected to
the indicated serial port. You might also try to unplug and re-plug the USB cable before attempting a reconnection.
Thank you.

1 件のコメント

Brais Gonzalez
Brais Gonzalez 2017 年 11 月 21 日
Answer for Error using arduino (line 104) Warning: Unsuccessful read: A timeout occurred before the Terminator was reached.
The answer is: 1 In the Arduino software(IDE). You need write the code, which you find in file "adioes.pde" There are three files adio, adioe, adioes. A for analog D for digital I for input O for Output E for encoder S for Servo. If you need a Servo o a encoder, you need put the code more complete adioes. 2 Compile this code and send to arduino. Close the IDE 3 To open matlab and to write a=arduino("COMxx") 4 You has finalized the Arduino instalation

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB Support Package for Arduino Hardware についてさらに検索

質問済み:

2016 年 1 月 27 日

コメント済み:

2017 年 11 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by