Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement