Contenuto principale

System Peripherals

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

GPIO ReadRead GPIO pin status
GPIO WriteSet GPIO pin status
LEDIlluminate built-in LED on Raspberry Pi board
SSD1306 OLED DisplayDisplay real time text or image on OLED display (Since R2026a)
EncoderMeasure incremental position and direction of rotating motor
ADS1x15Read 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