Using the user leds

The BeagleBone has 4 user leds located on the main board close to the Ethernet port.
They typically won't be visible if you put the BeagleBone in an enclosure, but they can be good for debugging and visually seeing the status.

The user leads are accessible from user land on the file system at this location:
  • /sys/devices/platform/leds-gpio/leds/
On the BeagleBone Black Rev C, they are here:
  • /sys/devices/ocp.3/gpio-leds.8/leds/beaglebone:green:usr0
There is one directly per user led, named:
  • /sys/devices/platform/leds-gpio/leds/beaglebone::usr0/
  • /sys/devices/platform/leds-gpio/leds/beaglebone::usr1/
  • /sys/devices/platform/leds-gpio/leds/beaglebone::usr2/
  • /sys/devices/platform/leds-gpio/leds/beaglebone::usr3/

Inside each directory, there is a file names "brightness". If you write a "0" or a "1" to this file, then you can control the status of that led.

Here is a sample command to turn on user led 1:
  • echo 1 > /sys/devices/platform/leds-gpio/leds/beaglebone\:\:usr1/brightness
BeagleBone Black Rev C:
  • echo 1 > /sys/devices/ocp.3/gpio-leds.8/leds/beaglebone:green:usr0/brightness


Note that user led 0 is already in use to indicate Ethernet activity, so you should use the user leds 1,2 and 3 for you projects.

For reference, this is the mapping to GPIO pins the user leds are mapped to:

USER LEDGPIO PIN 
User led 0GPIO1_21
User led 1GPIO1_22   
User led 2 GPIO1_23 
User led 3GPIO1_24




Comments