Skip to content

Instantly share code, notes, and snippets.

@EspaceRaspberryFrancais
Last active January 27, 2020 10:46
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 EspaceRaspberryFrancais/ab2bf9bddbf6f90e882cb68301a8b2f0 to your computer and use it in GitHub Desktop.
Save EspaceRaspberryFrancais/ab2bf9bddbf6f90e882cb68301a8b2f0 to your computer and use it in GitHub Desktop.
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
capteur = 7
GPIO.setup(capteur, GPIO.IN)
print "Demarrage du capteur"
time.sleep(2)
print "Capteur pret a detecte un mouvement"
while True:
if GPIO.input(capteur):
print "Mouvement detecte"
time.sleep(2)
time.sleep(0.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment