Simple Power Indicator Script?
Forums:
Hi, I just purchased a LEDBORG however my python skills are limited. I was wondering how a basic script to have the led turn on once the unit is powered on would look.
Basically when the unit turns on, I would like a blue light to turn on and remain until it is powered off.
Thanks!
I'm currently working on it through Raspbian but I mainly use the Pi for Retropie.
piborg
Sun, 06/04/2017 - 11:58
Permalink
Nice and simple
This should be nice and simple to do :)
First you want to create a script which sets the LedBorg to blue.
This can be based on LedBorg: lesson 1, but you do not need the delay or to turn the LedBorg off at the end.
You should end up with something like this:
I would recommend making the file in the
cd ~/ledborg
directory. Save it as something likepowerLed.py
.Next edit the startup script for the pi:
sudo nano /etc/rc.local
. You want to add a new line just above theexit
command to run this new script.The bottom of the file should end up looking something like this:
At this point the blue LED should come on when the Raspberry Pi is started :)
From memory that is all you need to do, I think the GPIO pins are switched off when the Raspberry Pi is shutdown anyway, which will make the LedBorg turn off.
Belchides
Wed, 06/07/2017 - 04:43
Permalink
Thanks brah. I'll try it
Thanks brah. I'll try it tomorrow.
Greatly appreciate your help dude.