I have a python script which have a pyqt5 Gui and I want in this Gui to know if a certain pin is toggeld. I did use
GPIO.setmode(GPIO.BOARD) GPIO.setup(7, GPIO.IN) GPIO.add_event_detect(7, GPIO.RISING, callback = change, bouncetime=3) def change(channel): channel_is_on =GPIO.input(channel) print(channel_is_on)
so what I received after I hooked the jumper was always 1 even I didn't turn it on. first how can I read just the toggle when it happen? what is the problem that the pin read high when it been hooked up?