Other languages
Signals for on Boad LEDs
2
1777
View: 1777|Reply: 2
|
[Other languages]
Signals for on Boad LEDs
[Copy link]
|
|
Edited by balli1187 at Feb 08, 2016 12:41
Hi Forum,
i have some questions about the LEDs on the Banana Pi Pro. There is one for power, one for network and another one i don't know its function.
I have read how they can be disabled and how they can be triggered bei GPIO.
My question is, how can bring the signal to an external LED (via GPIO-Pin). I have build a custom Case with LEDs and i want to bring the network-signal, eg to these external LED.
Has somebody done this before?
Best regards from germany,
Stephan
|
|
|
|
|
|
|
|
There are 3 leds; power, sd card i/o, network i/o
I think you can use signal from kernel:
You can read the status with:
- cat /sys/class/leds/led0/brightness
Copy the Code
verify if there is a trigger:
- cat /sys/class/leds/led0/trigger
- none [mmc0]
Copy the Code
For change value of leds if there is trigger you have to disable it:
- echo none >/sys/class/leds/led0/trigger
Copy the Code
Then you can set the power led value:
- echo 1 >/sys/class/leds/led0/brightness
- echo 0 >/sys/class/leds/led0/brightness
Copy the Code
And status led value:
- echo 1 >/sys/class/leds/led1/brightness
- echo 0 >/sys/class/leds/led1/brightness
Copy the Code
To return to the trigger function (like a reset):
- echo mmc0 >/sys/class/leds/led0/trigger
Copy the Code
Or you can control directly with GPIO:
- echo gpio | sudo tee /sys/class/leds/led1/trigger
Copy the Code
Hope it's useful.
Luca |
|
|
|
|
|
|
|
I am interested in this, too: I would like to connect external LEDs to the Banana and clone the ones on board.
But it doesn't seem that simple, as this:
cat /sys/class/leds/led0/brightness
cat: /sys/class/leds/led0/brightness: No such file or directory
|
|
|
|
|
|
|