I am utterly confused.
I'm using this code from gpiozero:
When I run it, it always, immediately says "The button was pressed!". Shouldn't it wait for me to press the button to print that?
I have a wire from pin 22 to one hole on my breadboard next to the button pin and one from the other side of the button to GND.
I tried multiple pins for the input, i tried multiple grounds.
I tried not connecting anything
I tried connecting the pins in the same row (that should have given me a button pressed notification immediately, but I was trying to check all the permutations)
What am i missing? sometimes the most obvious things are the hardest to see....
I'm using this code from gpiozero:
Code:
from gpiozero import Buttonbutton = Button(22)button.wait_for_press()print("The button was pressed!")
I have a wire from pin 22 to one hole on my breadboard next to the button pin and one from the other side of the button to GND.
I tried multiple pins for the input, i tried multiple grounds.
I tried not connecting anything
I tried connecting the pins in the same row (that should have given me a button pressed notification immediately, but I was trying to check all the permutations)
What am i missing? sometimes the most obvious things are the hardest to see....
Statistics: Posted by Blix666 — Sat Apr 05, 2025 10:56 pm