Skip to content

Comments

Create PIR motion#31

Open
Raspy94 wants to merge 1 commit intoBaReinhard:masterfrom
Raspy94:patch-6
Open

Create PIR motion#31
Raspy94 wants to merge 1 commit intoBaReinhard:masterfrom
Raspy94:patch-6

Conversation

@Raspy94
Copy link
Contributor

@Raspy94 Raspy94 commented Oct 3, 2020

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

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

Successfully merging this pull request may close these issues.

1 participant