Repurpose on board LEDs


7 posts
by megablue » Sat Jan 05, 2013 5:12 pm
Is there any way to programmatically take over the control of the on board LEDs? And perhaps restore their original behavior after that? It should be fairly useful for running the pi headlessly.
Posts: 1
Joined: Mon Mar 05, 2012 9:45 pm
by aTao » Sat Jan 05, 2013 5:18 pm
The power LED is hard wired to the power rail, so no luck with that one, likewise the network indicators are directly wired to the USB/ehternet ic, no luck there.
The ACT LED is, however, driven from GPIO #16, you can write what ever you want to it, but to stop the system using it as well might be tricky (kernel recompile?)
>)))'><'(((<
User avatar
Posts: 431
Joined: Wed Dec 12, 2012 10:41 am
Location: Swine Town UK
by Rene_is_I » Sat Jan 05, 2013 8:51 pm
Perhaps there is an option in a file somewhere to disable the system outputting to GPIO16 to indicate ACT
which would leave you free to use GPIO16 and hence the ACT Led for what ever you like.
Posts: 172
Joined: Tue Dec 25, 2012 12:52 pm
by johnbeetem » Sat Jan 05, 2013 10:25 pm
According to the LAN9512 data sheet, it is possible to use the three Ethernet LEDs as general-purpose I/O pins. However, I have no idea if the device driver makes this accessible to mere mortals.
User avatar
Posts: 938
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Coast
by Rene_is_I » Sat Jan 05, 2013 10:47 pm
It may well be that the 3 LEDs outputs on the LAN chip can be configured as general purpose
outputs but the problem is that the only way to "talk" to the LAN chip is via USB which adds
another layer of complexity.

The LAN9512 actually has 8 GPIOs.
The first 3 (GPIO 0 to 2) are the 3 leds.
Then GPIO 3 to 7 are on pins 35,36,37,42,43

However programing them could be rather difficult as it has to be via USB.
Posts: 172
Joined: Tue Dec 25, 2012 12:52 pm
by Rene_is_I » Sat Jan 05, 2013 11:21 pm
There is another way, use a RGB LED connected to 3 GPIO pins which will give you 8 possible
colours each indicating a certain condition of your choice.
If you use PWM, then you can have even more combinations.

Image
Posts: 172
Joined: Tue Dec 25, 2012 12:52 pm
by Rene_is_I » Sun Jan 06, 2013 11:58 am
Or if you need more combinations (10) and prefer them in numeric form, use a 7 segment LED display.
This will only use 4 GPIO lines, less if a shift register is used.

Image

Bigger image available here:

http://s1.postimage.org/4qiqn1pnj/7_seg.jpg
Posts: 172
Joined: Tue Dec 25, 2012 12:52 pm