Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass
Created October 25, 2020 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffersGlass/db75ebebda4c81ffaa901582f544ba12 to your computer and use it in GitHub Desktop.
Save JeffersGlass/db75ebebda4c81ffaa901582f544ba12 to your computer and use it in GitHub Desktop.
from gpiozero import MotionSensor
from time import sleep
i = 0
pir = MotionSensor(19)
while(1):
pir.wait_for_motion()
i = i + 1
print(f"Motion Detected! {i}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment