Hacktoberfest-Raspberry-Pi icon indicating copy to clipboard operation
Hacktoberfest-Raspberry-Pi copied to clipboard

Create PIR motion

Open Raspy94 opened this issue 5 years ago • 0 comments

def take_photo(): global i i = i + 1 camera.capture('/home/pi/Desktop/image_%s.jpg' % i) print('A photo has been taken') sleep(10)

#assign a function that runs when motion is detected pir.when_motion = take_photo

pause()

//take picture when motion detected

Raspy94 avatar Oct 03 '20 15:10 Raspy94