Browse Source

'PIR_01.py' löschen

Yang Zhang 4 years ago
parent
commit
a11bd8872a
1 changed files with 0 additions and 29 deletions
  1. 0 29
      PIR_01.py

+ 0 - 29
PIR_01.py

@@ -1,29 +0,0 @@
-import time
-import Adafruit_BBIO.GPIO as GPIO
-
-GPIO.setup("P9_15",GPIO.OUT)
-inPin = "P9_23"
-GPIO.setup(inPin, GPIO.IN)
-GPIO.add_event_detect(inPin,GPIO.RISING)
-
-try:
-	time.sleep(2)
-	while True:
-		if GPIO.event_detected("P9_23"):
-			GPIO.output("P9_15",GPIO.HIGH)
-			time.sleep(0.5)
-			GPIO.output("P9_15",GPIO.LOW)
-			print("Motion detected...")
-			time.sleep(3)
-		else:
-			print("---")
-			GPIO.output("P9_15",GPIO.LOW)
-                        #sleep(0.5)
-                        #GPIO.output("P9_15",GPIO.LOW)
-			#sleep(0.5)
-			#GPIO.output("P9_15",GPIO.HIGH)
-                        #sleep(0.5)
-                        #GPIO.output("P9_15",GPIO.LOW)
-			time.sleep(2)
-except:
-	GPIO.cleanup()