I have a problem working with some IR Sensors. They are supposed to trigger "my_callback" when they do not sense an IR signal. At the moment they trigger as soon as they DO recieve an IR signal.
I made following script to show what my problem is:
import RPi.GPIO as GPIO
import time
channel = 23
GPIO.setmode(GPIO.BCM)
GPIO.setup(channel, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
def my_callback(channel):
print("test")
while True:
GPIO.add_event_detect(channel, GPIO.RISING, callback=my_callback, bouncetime=10)
"test" gets printed when the sensors recieve a signal but it should be the other way around. I have tried GPIO.FALLING and PUD_UP but it still acts the same way.
Does someone know how to do this?
Thanks in advance.