Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yq3w opened this issue Aug 20, 2020 · 0 comments

Comments

@yq3w
Copy link

yq3w commented Aug 20, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant