Delete monitor_gpio_buttons.py
This commit is contained in:
parent
1181788e5d
commit
f0af97ad7a
1 changed files with 0 additions and 28 deletions
|
|
@ -1,28 +0,0 @@
|
|||
#Written by Mari DeGrazia
|
||||
#arizona4n6@gmail.com
|
||||
#This script will monitor a button on GPIO 13
|
||||
#When pressed it will kill the photobooth python script
|
||||
|
||||
import RPi.GPIO as GPIO
|
||||
import time
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
GPIO.setup(13, GPIO.IN, pull_up_down=GPIO.PUD_UP)
|
||||
|
||||
while True:
|
||||
input_state = GPIO.input(13)
|
||||
if input_state == False:
|
||||
time.sleep(0.3)
|
||||
cmd = "sudo pkill -f photobooth.py"
|
||||
k = subprocess.Popen(cmd,shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
message = k.communicate(input)
|
||||
print message[0]
|
||||
|
||||
|
||||
cmd = "sudo pkill -f photobooth_wii.py"
|
||||
k = subprocess.Popen(cmd,shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
message = k.communicate(input)
|
||||
print message[0]
|
||||
|
||||
Loading…
Reference in a new issue