How to connect an Arduino to Matlab run on a Mac? Error using serial/fopen (line 72)

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.

Categorías

Más información sobre Instrument Control Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 23 de Jul. de 2015

Respondida:

el 24 de Sept. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by