by default, it is set triggered by mmc0. It can be checked with the command:
# cat /sys/class/leds/led0/trigger
none [mmc0] timer oneshot heartbeat backlight gpio cpu0 default-on
In order to program it as GPIO, remove the trigger with the command:
# echo none >/sys/class/leds/led0/trigger
Then, to turn on the LED, enter the command:
# echo 1 >/sys/class/leds/led0/brightness
Then, to turn off the LED, enter the command:
# echo 0 >/sys/class/leds/led0/brightness
After that, resume the trigger by mmc0 with command (or reboot):
# echo mmc0 >/sys/class/leds/led0/trigger
Control the on-board LED on Raspberry Pi |
In my experience, it cannot be perform using sudo, you have to login as root. To login as root, refer to last post "Set password of root".
Related:
- Control the on-board LED using Python
- Python/RPi.GPIO Control Raspberry Pi 2 B on-board ACT LED
- Python control Raspberry Pi 2 PWR/ACT LED, using RPi.GPIO or system's shell
- Control the on-board LED using C language
3 comments:
Works with sudo as well, as follows:
sudo sh -c "echo 0 > /sys/class/leds/led0/brightness"
sudo sh -c "echo 1 > /sys/class/leds/led0/brightness"
thanks for your info:)
Hi, I would like to mount an external LED to monitorize the ACT LED onboard because is not very confortable to check this LED when the Raspi is a few meters away or enclosed in its box. You say that this LED is connected GPIO 16 but, Can I connect directly an external LED to this pin to get a "reply" of the ACT LED?
Post a Comment