Hallo,
wie kann ich GPIO. setup(27, GPIO.OUT)
als FALLING Flanke von GPIO. input(27)== GPIO.LOW abfragen?
MIt GPIO.IN weiss ich wie das geht aber mit GPIO.OUT?
Dieses script funktioniert so weit, aber das Licht ist immer aus da es immer wieder von GPIO.input(27) == GPIO.LOW auf aus gesteuert wird.
Brauche desshalb eine Erkennung mittels FALLING Flanke.
Python
#!/usr/bin/env python
import time
from time import sleep
import RPi.GPIO as GPIO
import subprocess
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(27, GPIO.OUT)
while True:
sleep(0.1)
if GPIO.input(27)== GPIO.LOW:
subprocess.call(„/home/pi/th/licht_aus.py“)
print(„Lampe aus“)
GPIO.cleanup()
Alles anzeigen
Koennt ihr mir da bitte auf die Spruenge helfen?
Gruss
Thomas