device
R2026bConnection to serial device on Arduino or ESP32 hardware
Description
Add-On Required: This feature requires the MATLAB Support Package for Arduino Hardware add-on.
This object represents a connection to the serial device connected to Arduino® or ESP32 hardware. You can interact with the serial device using the functions listed in Object Functions.
Creation
Syntax
Description
creates an object that represents the connection between the serial device connected to
the Arduino or ESP32 hardware at the serial port specified by
serialdevObj = device(arduinoObj,'SerialPort',SerialPort)SerialPort. The Arduino hardware is represented by an arduino object.
creates an object that represents the connection with additional options specified by one
or more name-value arguments between the serial device connected to the Arduino or ESP32 hardware.serialdevObj = device(arduinoObj,'SerialPort',SerialPort,Name=Value)
Input Arguments
Name-Value Arguments
Properties
Examples
More About
Alternative Functionality
App
Use Arduino Explorer to configure the serial device and then read and write data to serial devices connected to Arduino or any other supported hardware. You can use the app in the installed version of MATLAB and MATLAB Online™. For more information, see Connect to Serial Device Using Arduino Explorer App.
Version History
Introduced in R2019b