Hey all,
I’m trying to read a button input on GPIO15 using MicroPython on the Pico, but it always returns “1” even when the button’s pressed. I’ve set it as Pin.IN with a pull-down, and wired it to 3.3V through the button. Not sure what I’m missing…bad wiring maybe?
If you’re using an internal pull down* you won’t need to hook it up to 3.3V at all. You will be able to connect it up just it is in the photo below (using GPIO15 is fine).
*edit: A pull up would instead be required, not a pull down.
If using an internal pull down, then with no button connected it should already be at ground. As such you would need to have the switch go Pin 15 → button → +3.3V to trigger a change in the pin state from ground to 3.3V when the button is pressed.
On the other hand if you used an internal pull-up, then the switch can then pull down to ground as per your image..
I assume this is a correct pin out for that part of the Pico
@Donna294536
How did you go, did you find the source of your issue ?
If not, maybe supply the code used and a diagram of how you wired it.
Could be as simple as the pins on the button (if more then 2), so maybe buzz them out to ensure the chosen pins are connected via the button press.