04-12-2020, 06:29 PM
OK, so now I've actually read Tim's earlier reply:
I haven't played with the GPIO package but I interpret this line to mean the pin is enabled as an input pin with its internal pull-up resistor (within the RPi) enabled, which means the pin is already tied to +3.3v through ca 50Kohm. If this is so, then a push button which momentarily connects the pin to +3.3v won't cause a transition.
I expect you have either to change the code to enable the pull-down resistor or to change the switch to connect to ground instead of +3.3v.
Or I could be off in left field again
Regards,
Kent
Code:
GPIO.setup(sw_1_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
I haven't played with the GPIO package but I interpret this line to mean the pin is enabled as an input pin with its internal pull-up resistor (within the RPi) enabled, which means the pin is already tied to +3.3v through ca 50Kohm. If this is so, then a push button which momentarily connects the pin to +3.3v won't cause a transition.
I expect you have either to change the code to enable the pull-down resistor or to change the switch to connect to ground instead of +3.3v.
Or I could be off in left field again

Regards,
Kent