device
R2026bConnection to device on SPI bus 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 SPI device on Arduino® or ESP32 hardware. Attach an SPI device to the appropriate pins on the Arduino or ESP32 hardware. You can interact with the SPI device using the functions listed in Object Functions.
Creation
Description
creates an object that represents the connection between SPI device connected to the SPI
bus on the Arduino or ESP32 hardware. The Arduino or ESP32 hardware is represented by an deviceObj = device(arduinoObj,'SPIChipSelectPin',SPIChipSelectPin,Name=Value)arduino object.
You can also customize the connection further using one or more name-value arguments. The
'SPIChipSelectPin' name-value argument is mandatory for creating the SPI
device connection.
Input Arguments
Name-Value Arguments
Properties
Object Functions
writeRead | Write and read data from SPI device |
Examples
More About
Alternative Functionality
App
Use Arduino Explorer to configure the SPI device to read and write data. You can use the app in the installed version of MATLAB and MATLAB Online™. For more information, see Connect to SPI Device Using Arduino Explorer App.
Version History
Introduced in R2019a