diff --git a/shutdownbutton.py b/shutdownbutton.py index b70ebb7..10219a6 100644 --- a/shutdownbutton.py +++ b/shutdownbutton.py @@ -3,15 +3,18 @@ import RPi.GPIO as GPIO import time import os + GPIO.setmode(GPIO.BCM) GPIO.setup(buttonpin, GPIO.IN, pull_up_down=GPIO.PUD_UP) while True: print "waiting..." + os.system('logger shutdownbutton waiting for press...') try: GPIO.wait_for_edge(buttonpin, GPIO.FALLING) print('Button Pressed') + os.system('logger shutdownbutton pressen. bye bye') os.system("shutdown now -h") except KeyboardInterrupt: GPIO.cleanup() # clean up GPIO on CTRL+C exit