fixed some symboles gone wrong from copying
This commit is contained in:
@@ -1,33 +1,33 @@
|
||||
import RPi.GPIO as GPIO
|
||||
import time
|
||||
import os
|
||||
|
||||
|
||||
#Board Mode: Angabe der Pin-Nummer
|
||||
GPIO.setmode(GPIO.BOARD)
|
||||
|
||||
|
||||
#GPIO Pin definieren fuer den Dateneingang vom Sensor
|
||||
PIR_GPIO = 16
|
||||
GPIO.setup(PIR_GPIO,GPIO.IN)
|
||||
|
||||
read=0
|
||||
wait=0
|
||||
|
||||
|
||||
read = 0
|
||||
wait = 0
|
||||
|
||||
try:
|
||||
#PIR auslesen
|
||||
while GPIO.input(PIR_GPIO)==1:
|
||||
read=0
|
||||
while GPIO.input(PIR_GPIO) == 1:
|
||||
read = 0
|
||||
|
||||
#Abbruch ctrl+c
|
||||
while True :
|
||||
#PIR Status abfragen
|
||||
read = GPIO.input(PIR_GPIO)
|
||||
|
||||
if read==1 and wait==0:
|
||||
if read == 1 and wait == 0:
|
||||
os.system("vcgencmd display_power 1")
|
||||
wait=1
|
||||
wait = 1
|
||||
|
||||
elif read==0 and wait==1:
|
||||
wait=0
|
||||
elif read == 0 and wait == 1:
|
||||
wait = 0
|
||||
|
||||
time.sleep(0.01)
|
||||
|
||||
|
Reference in New Issue
Block a user