The buttons will connect the gpio pin to ground if pressed, or float if not pressed.
I use the internal pull up resistors then to avoid the float, like so:
which works great. But I'm currently using a series resistor for the single button I'm testing.
Code: Select all
GPIO.setup(11, GPIO.IN, pull_up_down=GPIO.PUD_UP) (et al)
I know people will say "resistors are cheap" but the issue here is that I would prefer to not have any resistors hanging directly off one side of the switch, it's a bit annoying and a design weakness imo. My chassis doesn't have anything in it besides my rpi and the buttons. I would prefer to not have to etch a circuit board with headers and resistors...seems asinine.
So I would strongly prefer to omit the series resistors if they are not needed.
Is that acceptable?