Search This Blog

Saturday, March 21, 2015

How to control LEDs using only Linux commands

I just learned how to control LEDs on the BBB using just basic linux command. Let's see...

1. I'm using Ubuntu running on the BBB board for this article. First login into the board and become root with command ...
$sudo bash

2. Access to /sys/class/leds , you can find 4 folders that contain control files for all USER 4 LEDs.

3. Let's control LED number 4 (the one that placed next to the Ethernet Port). Access the beaglebone:green:usr3 folder.

4. You can see the values inside control files with cat command.

5. Use this comand to turn On/Off LED
# echo 1 > brightness
# echo 0 > brightness

6. To blinking the LED, use this command ...
# echo timer > trigger
# echo 1000 > delay_off
# echo 500 > delay_on

That is for today. See you next time :)