Setting up On-Screen Battery and Safe Shutdown Button
These instructions are described in detail here.
Run the installation commands for Mintybatterymonitor:
cd ~ wget https://raw.githubusercontent.com/HoolyHoo/Mintybatterymonitor/master/MintyInstall.sh sudo git clone https://github.com/HoolyHoo/Mintybatterymonitor.git sudo chmod 777 MintyInstall.sh sudo ./MintyInstall.shThat last line will take awhile as it also updates the already-installed software.
If you're using a GPIO Assist board and have attached a Safe Shutdown button, use these instructions:
sudo nano Mintybatterymonitor/MintyShutdown.pyScroll to the bottom and change it to the following:
# Interrupts shutdown_btn = Button(4, hold_time=2) shutdown_btn.when_held = shutdown shutdown_btn.when_released = togglestate pause()Save the changes using Ctrl-X, Y, Enter.
After rebooting, single-tapping the safe shutdown button will toggle the on-screen battery.
(Note that it will take a few seconds before it appears.)
Holding the safe shutdown button for a couple of seconds will shutdown the system. After the screen goes blank, wait at least five seconds and then power off the device. This will ensure that it's no longer writing to the SD card. (If you peek inside the case past the SD card, you should see the green LED switch off.)