SHARE
TWEET

Untitled

a guest Oct 18th, 2019 80 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top