I use following setup:
GPIO in is BCM pin 17 / board pin 11
GND is GND
VCC is 3,3v
I made this super basic script that says if it’s 1 or 0 when ran:
input_pin = 17 # BCM pin 17, BOARD pin 11
GPIO.setup(input_pin, GPIO.IN) # set pin as an input pin
value = GPIO.input(input_pin)
the script seems to work only once, for example:
When the switch is open I get 0
When I then close the switch I get 1
If I then open the switch again it stays at 1 instead of going back to 0
Why wouldn’t it go back to 0?
Am I missing something?
The goal is being able to read if the circuit is open or closed.