Guest User

Untitled

a guest
Oct 18th, 2019
84
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python3
  2.  
  3. from periphery import GPIO
  4. from subprocess import call
  5. import time
  6.  
  7. gpio_shutdown = GPIO(6, "in")
  8.  
  9. while True:
  10. value = gpio_shutdown.read()
  11.  
  12. if value == True:
  13. gpio_shutdown.close()
  14. call(['shutdown', 'now'], shell=False)
  15.  
  16. time.sleep(1)
RAW Paste Data