How to connect an Arduino to Matlab run on a Mac? Error using serial/fopen (line 72)
Show older comments
I downloaded Arduino software, established Arduino connection to Arduino software, but I'm unable to connect the Arduino with Matlab.
Input:
s = serial('/dev/tty.usbmodem1411')
Output:
Communication Settings
Port: /dev/tty.usbmodem1411
BaudRate: 9600
Terminator: 'LF'
Communication State
Status: closed
RecordStatus: off
Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 0
Input:
set(s,'DataBits',8); set(s,'StopBits',1); set(s,'BaudRate',9600); set(s,'Parity','none'); fopen(s);
Output: error using serial/fopen(line 72) Open failed: cannot connect to the /dev/tty.usbmodem1411 port. Possible reasons are another application is connected to the port or the port does not exist.
Answers (1)
Madhu Govindarajan
on 24 Sep 2015
0 votes
Have you tried the support package for arduino? It is a free download - http://www.mathworks.com/hardware-support/arduino-matlab.html
Categories
Find more on Instrument Control Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!