Why does connection error pops up?

조회 수: 1 (최근 30일)
madhan ravi
madhan ravi 2019년 2월 1일
댓글: Madhu Govindarajan 2019년 2월 1일
Whenever I try to connect Matlab with arduino I get :
>> a=arduino
Failed to open a connection at serial port /dev/cu.usbmodem1421.
Make sure the port or address is correct and the Arduino hardware
is properly plugged in. For troubleshooting, see Arduino Hardware
Troubleshooting.
The port connection is correct though (it works in arduino application).
System: macbook pro 2012
edit: when I restart matlab it doesn't appear any reasons?

채택된 답변

Madhu Govindarajan
Madhu Govindarajan 2019년 2월 1일
I have had similar issues in the past on Windows machines and I usually put the board in bootloader mode to make the error go away.
Note for new Arduino users - Double pressing the reset button makes the board go into bootloader mode.
  댓글 수: 2
madhan ravi
madhan ravi 2019년 2월 1일
Thank you , why does it happen though? Could you share some resources to get acquainted with arduino through matlab especially stepper motor (using arduino uno) ?
Madhu Govindarajan
Madhu Govindarajan 2019년 2월 1일
Here is a video that shows basics of controlling motors from MATLAB and Arduino - https://www.mathworks.com/videos/using-matlab-and-arduino-for-motor-control-100737.html
I think the reason it happens is - even though the object is cleared, the connection is persistent and prevents MATLAB from downloading the server sketch to Arduino. When you put it on bootloader mode, you are forcing the Arduino to reset everything using the firmware and this helps to reestablish new connections.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by