It's my understanding that if a switch is wired to ground and the other to a GPIO pin you need a pull-up on the GPIO. Then the GPIO will usually read high and will usually read low when the switch is closed.
GPIO.setmode(GPIO.BCM)
GPIO.setup(16, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.input(16)
However, this appears to be the opposite for me. Using the code above my button, (connected to ground and GPIO 16) reads True/1 when pushed/pressed, why?
This is the button I'm using:
Normally-Open
(NO) orNormally Closed
(NC) Switch. No way to tell from a picture