pistreaming icon indicating copy to clipboard operation
pistreaming copied to clipboard

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

Open yq3w opened this issue 5 years ago • 0 comments

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()

yq3w avatar Aug 20 '20 16:08 yq3w