2017-05-10 16:05:53 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
|
|
|
|
import RPi.GPIO as GPIO
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
|
|
|
GPIO.setmode(GPIO.BCM)
|
2017-06-25 15:26:49 +00:00
|
|
|
GPIO.setup(3, GPIO.IN, pull_up_down=GPIO.PUD_UP)
|
2017-05-10 16:05:53 +00:00
|
|
|
GPIO.wait_for_edge(3, GPIO.FALLING)
|
|
|
|
|
|
|
|
subprocess.call(['shutdown', '-h', 'now'], shell=False)
|