switched to gitea

This commit is contained in:
Justin Eckenweber
2026-05-20 10:29:00 +02:00
commit dc442f29bc
6 changed files with 599 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import RPi.GPIO as GPIO
import time
sensor_pin = 22
GPIO.setmode(GPIO.BCM)
GPIO.setup(sensor_pin, GPIO.IN)
state = 0
try:
while True:
val = GPIO.input(sensor_pin)
if val == 1:
#GPIO.output(led_pin, GPIO.HIGH)
if state == 0:
print("Motion detected!")
state = 1
else:
#GPIO.output(led_pin, GPIO.LOW)
if state == 1:
print("Motion stopped!")
state = 0
time.sleep(0.1)
except KeyboardInterrupt:
GPIO.cleanup()