Skip to content

Instantly share code, notes, and snippets.

@Technicus
Created October 19, 2015 19:21
Show Gist options
  • Save Technicus/890b2322740023c89c31 to your computer and use it in GitHub Desktop.
Save Technicus/890b2322740023c89c31 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
from time import sleep
import RPi.GPIO as GPIO
import subprocess
import os
buttonPress = 0
streamOn = 0
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
GPIO.setup(27, GPIO.IN)
while 1:
if GPIO.input(27):
GPIO.output(17, True)
GPIO.setup(27, GPIO.OUT)
subprocess.call("/home/pi/Utility/video/Camera-Stream.sh", shell=True)
GPIO.setup(27, GPIO.IN)
else:
GPIO.output(17, False)
os.system("killall -9 mjpg_streamer")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment