Merge branch 'master' of git.tnet.space:Bryan/chip-battery
commit
b8ed3f5f39
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash/
|
||||
#!/bin/bash
|
||||
#
|
||||
# library based on work by: @author Raoul R., 2016
|
||||
#
|
||||
|
|
@ -88,9 +88,6 @@ function setLed() {
|
|||
# @return ... true if button pressed else false as return value
|
||||
function isButtonPressed() {
|
||||
local value=$(cat ${POWER_BUTTON_GPIO}/value)
|
||||
|
||||
|
||||
|
||||
if [ "$value" -eq "0" ] ; then
|
||||
shutdownCommand "shutdown on button pressed"
|
||||
fi
|
||||
|
|
@ -104,16 +101,16 @@ function verifyButton() {
|
|||
}
|
||||
|
||||
function main() {
|
||||
setupGpioInputButton
|
||||
|
||||
# setupGpioInputButton
|
||||
echo "hello"
|
||||
while true ; do
|
||||
setLed 1
|
||||
# setLed 1
|
||||
verifyBatteryVoltage
|
||||
setLed 0
|
||||
# setLed 0
|
||||
sleep 3
|
||||
done
|
||||
}
|
||||
|
||||
# start monitoring in subshell and nonblocking
|
||||
$(main)
|
||||
main
|
||||
#exit 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue