Main Content

Serial Devices

R2026b
Read and write to serial devices connected to Arduino® hardware

Create an Arduino object using arduino before you use serial streaming functions.

You can use Arduino Explorer to interactively configure the serial communication interface and use the interface to read and write data to serial devices connected to Arduino and other supported hardware in MATLAB® and MATLAB Online™. For more information, see Connect to Serial Device Using Arduino Explorer App.

For a complete list of hardware supported in the installed version of MATLAB, see Supported Hardware. For more information regarding supported boards, workflows, and platforms supported on MATLAB Online, see Get Started with MATLAB Online for Arduino.

Functions

deviceConnection to serial device on Arduino or ESP32 hardware
readRead data from serial device
writeWrite data to serial device

Topics

Troubleshooting

Serial Device Issues

Tips to fix issues for serial devices.