You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()
The text was updated successfully, but these errors were encountered:
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()
The text was updated successfully, but these errors were encountered: