waveform80/pistreaming

hello! ctr+C Stopping recording .Is there another way to stop recording?thank you!

Opened this issue · 0 comments

yq3w commented

import os
import RPi.GPIO as GPIO
from picamera import PiCamera
from time import sleep

GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(17,GPIO.IN, pull_up_down = GPIO.PUD_UP )#接上轻触开关,一个脚接地
GPIO.setup(18,GPIO.OUT) #接LED灯

GPIO.add_event_detect(17, GPIO.RISING) # 在通道上添加上管脚触发方式

flag = 1
while True:
if GPIO.event_detected(17): #判断按键按下事件
if flag:
#os.system("sudo systemctl start create_ap.service")
GPIO.output(18,True)
os.system("python3 /home/pi/pistreaming/server.py")
else:
### (Is there another way to stop recording)
flag = not flag

GPIO.cleanup()