Last active
June 27, 2016 11:28
-
-
Save lvidarte/83019cf6283bbed9c257488cbbf54e75 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gpiozero import MotionSensor, Buzzer | |
import time | |
pir = MotionSensor(22) | |
bz = Buzzer(17) | |
print("Waiting for PIR to settle") | |
pir.wait_for_no_motion() | |
while True: | |
print("Ready") | |
pir.wait_for_motion() | |
print("Motion detected!") | |
bz.beep(0.5, 0.25, 8) | |
time.sleep(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment