٢٠١٨/١/٦ Connect to Arduino Hardware - MATLAB & Simulink
Connect to Arduino Hardware
This example shows how to connect to Arduino® hardware in MATLAB®.
Make sure the Arduino hardware is connected to the computer. If the device is unofficial, note the port and board name.
Connect to an official Arduino hardware.
a = arduino()
a =
arduino with properties:
Port: 'COM25'
Board: 'Uno'
AvailableAnalogPins: [0 1 2 3 4 5]
AvailableDigitalPins: [2 3 4 5 6 7 8 9 10 11 12 13]
Libraries: {'I2C' 'SPI' 'Servo'}
Connect by specifying the port and board name.
If you are using an unofficial (clone) Arduino hardware, specify port and board name to establish connection.
a = arduino('COM3','Uno')
a =
arduino with properties:
Port: 'COM3'
Board: 'Uno'
AvailableAnalogPins: [0 1 2 3 4 5]
AvailableDigitalPins: [2 3 4 5 6 7 8 9 10 11 12 13]
Libraries: {'I2C' 'SPI' 'Servo'}
https://www.mathworks.com/help/supportpkg/arduinoio/ug/connect-to-arduino-hardware.html 1/1