You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import subprocess
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
# GPIO3 (pin 5) set up as input. It is pulled up to stop false signals
GPIO.setup(3, GPIO.IN, pull_up_down=GPIO.PUD_UP)
# wait for the pin to be sorted with GND and, if so, halt the system
GPIO.wait_for_edge(3, GPIO.FALLING)
subprocess.call(['shutdown -h now "System halted by GPIO action"'], shell=True)
# clean up GPIO on normal exitGPIO.cleanup()
The text was updated successfully, but these errors were encountered:
https://github.com/g0to/misc_scripts/blob/master/raspi_gpio_actions_INT.py
The text was updated successfully, but these errors were encountered: