Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- from periphery import GPIO
- from subprocess import call
- import time
- gpio_shutdown = GPIO(6, "in")
- while True:
- value = gpio_shutdown.read()
- if value == True:
- gpio_shutdown.close()
- call(['shutdown', 'now'], shell=False)
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement