DocumentationHelp CenterDocumentation
Show location, name, and color of user-controllable LEDs
showLEDs(mypi)
example
showLEDs(mypi) displays the location, name, and color of the user-controllable LEDs on the current board.
mypi
collapse all
You can locate and control the on-board LED, turning it on and off.
Create a connection from the MATLAB® software to the Raspberry Pi™ board.
mypi = raspi
mypi = Raspi with Properties: DeviceAddress: 'raspberrypi-hysdu8X38o' Port: 18725 BoardName: 'Raspberry Pi Model B Rev 2' AvailableLEDs: {'led0'} AvailableDigitalPins: [4 14 15 17 18 22 23 24 25 27 30 31] AvailableSPIChannels: {} AvailableI2CBuses: {'i2c-0' 'i2c-1'} I2CBusSpeed: 100000 Supported peripherals
The AvailableLEDs property shows the name of the user-controllable LED.
AvailableLEDs
Show the location of the user-controllable LED on the board.
Turn on the specified LED by setting its value to 1 or true.
1
true
writeLED(mypi,'led0',1)
Turn off the LED by setting its value to 0 or false.
0
false
writeLED(mypi,'led0',false)
Restarting the Raspberry Pi hardware returns the LED to its previous function as an activity indicator.
Connection to a specific Raspberry Pi hardware board, specified as a raspi object.
raspi
MATLAB Support Package for Raspberry Pi Hardware | raspi | showLEDs | writeLED
showLEDs
writeLED
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office