Main Content

System Peripherals

R2026b
Monitor and control Raspberry Pi® hardware system peripherals

Access and manage essential hardware interfaces on Raspberry Pi hardware using MATLAB® functions and Simulink® blocks. Read from and write to GPIO pins, control onboard LEDs, interface with rotary encoders, and acquire analog data using external ADCs. Use these capabilities to build interactive, sensor-driven, and automated applications.

Blocks

Raspberry Pi GPIO Read iconGPIO ReadRead GPIO pin status
Raspberry Pi GPIO Write iconGPIO WriteSet GPIO pin status
Raspberry Pi LED blockLEDIlluminate built-in LED on Raspberry Pi board
Raspberry Pi SSD1306 OLED Display Block IconSSD1306 OLED DisplayDisplay real time text or image on OLED display (Since R2026a)
Raspberry Pi Encoder block iconEncoderMeasure incremental position and direction of rotating motor
Raspberry Pi ADS1x15 Block IconADS1x15Read digital output data from ADS1015 and ADS1115 ADCs (Since R2023a)

Model Settings

Hardware boardSelect the hardware board upon which to run your model
Device AddressEnter the IP address or host name of the hardware board
Device NameDevice name (Since R2026a)
UsernameEnter the root user name for Linux running on the hardware board
PasswordEnter the root password for Linux running on the hardware board

Objects

raspiConnection to Raspberry Pi board

Functions

configurePinConfigure GPIO pin as digital input, digital output, or PWM output
readDigitalPinRead logical value from GPIO input pin
writeDigitalPinWrite logical value to GPIO output pin
showPinsShow diagram of GPIO pins
writeLEDTurn LED on or off
showLEDsShow location, name, and color of user-controllable LEDs
systemRun command in Linux shell on Raspberry Pi hardware
getFileTransfer file from Raspberry Pi hardware to host computer or MATLAB Drive
putFileTransfer file from host computer to target hardware
deleteFileDelete file on target hardware
openShellOpen terminal on host computer to use Linux shell on Raspberry Pi hardware

Apps

Raspberry Pi Resource Monitor AppMonitor and manage Raspberry Pi resources

Topics

Troubleshooting

Troubleshoot Connecting Issues to Raspberry Pi Hardware

Troubleshoot issues while connecting to your Raspberry Pi hardware.

Featured Examples