Connect to SPI Device Using Arduino Explorer App
R2026bArduino Explorer app lets you configure the Serial Peripheral Interface (SPI) communication interface, which you can then use to read and write data to SPI devices connected to the Arduino hardware.
Open the Arduino Explorer app and connect to your Arduino board. You can launch the
app from the MATLAB Apps tab, by entering arduinoExplorer at the
MATLAB command prompt, or from the Hardware
Manager.
To start setting up an SPI device, once the app is open, click the SPI icon in the Configure section of the app. Use the Set Up SPI Device dialog box to select the chip select pin and configure the SPI communication properties. Specify the bit order required by the SPI device, select the SPI mode that matches the clock timing requirements in the device datasheet, and choose a bit rate supported by both the Arduino board and the SPI device. These settings determine how the Arduino exchanges data with the connected SPI device. Use Reset to restore the default SPI settings for the selected board.
Note
To identify the pins that can be used as chip select pins, see Chip Select Pins.

After you set the values, click OK. The app configures all the pins that support SPI to communicate using that protocol. The Pin explorer lists all this pins in one row.

To control the precision in read and write operations, select the row and set the Precision value in the Pin Configuration panel.
The app updates the values in the Pin Explorer Read Value column.
To write data to the SPI pins, enter a value in the Write Value column. Writing data to the device causes the app to read an equal number of bytes into the Read Value column.
For more information on recording and visualizing data, see Visualize and Record Data from Arduino Pins Using Arduino Explorer App.
See Also
Topics
- Set Up and Connect to Arduino and Arduino-compatible Boards Using Arduino Explorer
- Visualize Pin Diagram Using Arduino Explorer App
- Configure Read and Write for GPIO Pins Using Arduino Explorer App
- Connect to I2C Device Using Arduino Explorer App
- Connect to Serial Device Using Arduino Explorer App
- Visualize and Record Data from Arduino Pins Using Arduino Explorer App
- Generate MATLAB Script
- Customizable Views in the App