Last active
January 27, 2020 10:46
-
-
Save EspaceRaspberryFrancais/ab2bf9bddbf6f90e882cb68301a8b2f0 to your computer and use it in GitHub Desktop.
This file contains 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
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