testcode.py aktualisiert
This commit is contained in:
parent
5c42e26d41
commit
542c81bc13
28
testcode.py
28
testcode.py
@ -1,14 +1,14 @@
|
|||||||
from gpiozero import MotionSensor
|
from gpiozero import MotionSensor
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
# Dein OUT-Kabel steckt an GPIO17
|
# Das OUT-Kabel steckt an GPIO17
|
||||||
pir = MotionSensor(17)
|
pir = MotionSensor(17)
|
||||||
|
|
||||||
print("PIR Sensor Test gestartet...")
|
print("PIR Sensor Test gestartet...")
|
||||||
print("Warte auf Bewegung...")
|
print("Warte auf Bewegung...")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
pir.wait_for_motion()
|
pir.wait_for_motion()
|
||||||
print("Bewegung erkannt!")
|
print("Bewegung erkannt!")
|
||||||
pir.wait_for_no_motion()
|
pir.wait_for_no_motion()
|
||||||
print("Keine Bewegung mehr.")
|
print("Keine Bewegung mehr.")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user