Delete monitor_gpio_buttons.py

This commit is contained in:
James Devine 2018-08-25 22:23:24 +02:00 committed by GitHub
parent 1181788e5d
commit f0af97ad7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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]