Merge pull request #3 from Jordan-Fielding/Development

Update main.py
This commit is contained in:
Jordan-Fielding
2022-07-08 13:58:31 +10:00
committed by GitHub

10
main.py
View File

@@ -10,7 +10,8 @@ pir = MotionSensor(4)
camera = PiCamera() #Camera Initialization
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM) #Setting the GPIO Mode
GPIO.setup(22, GPIO.OUT) #LED output pin
GPIO.setup(22, GPIO.OUT) #LED Flash Output
GPIO.setup(27, GPIO.OUT) #LED indicator output
cwd = os.getcwd() #Sets the Current Working Directory
@@ -21,6 +22,13 @@ def bugmotion():
GPIO.output(22, 0) #Sets light off
print("\nProgram Running!")
for i in range(5):
GPIO.output(27, 1)
time.sleep(0.2)
GPIO.output(27, 0)
if i == 5:
break
#To stabilize sensor and Camera
time.sleep(2)