Added a shutdown button

This commit is contained in:
Balthasar Reuter
2015-06-04 15:26:57 +02:00
parent 7c9afab7c9
commit 2e350ae043

View File

@@ -405,6 +405,7 @@ def setup_gpio():
GPIO.setmode(GPIO.BCM)
# Setup the trigger channel as input and listen for events
GPIO.setup(gpio_trigger_channel, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(gpio_shutdown_channel, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.add_event_detect(gpio_trigger_channel, GPIO.RISING, callback=handle_gpio, bouncetime=200)
else:
print("Warning: RPi.GPIO could not be loaded. GPIO disabled.")