Documentation Center

  • Trial Software
  • Product Updates

showLEDs

Show location, name, and color of user-controllable LEDs

Syntax

  • showLEDs(mypi)

Description

showLEDs(mypi) displays the location, name, and color of the user-controllable LEDs on the current board.

Examples

expand all

Control the On-Board LED

You can locate and control the on-board LED, turning it on and off.

Create a connection to the Raspberry Pi™ board.

mypi = raspi
mypi = 

  Raspi with Properties:

           DeviceAddress: 'raspberrypi-computername'
                    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.

Show the location of the user-controllable LED on the board.

showLEDs(mypi)

Turn the specified LED on by setting its value to 1 or true.

writeLED(mypi,'led0',1)

Turn the LED off by setting its value to 0 or false.

writeLED(mypi,'led0',false)

Rebooting the Raspberry Pi hardware returns the LED to its previous function as an activity indicator.

Input Arguments

expand all

mypi — Connection to specific boardhandle

Connection to a specific board, specified as a handle.

Use raspi to create this connection.

Example: mypi

See Also

| | | |

Was this topic helpful?