Main Content

SPI Devices

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

Create an Arduino object using arduino before you use SPI functions. See Connect to Arduino Hardware for more information. You can use Arduino Explorer to interactively configure the SPI communication interface to read and write data to SPI devices connected to Arduino and other supported hardware in MATLAB® and MATLAB Online™. For more information, see Connect to SPI 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.

Note

All functions generate code using the MATLAB Function block. For more details, see Deploy Arduino Functions to Arduino Hardware Using MATLAB Function Block.

Functions

deviceConnection to device on SPI bus on Arduino or ESP32 hardware
writeReadWrite and read data from SPI device

Topics