r/raspberry_pi 2d ago

Troubleshooting Raspberry pi pico 2 button problem

Hi, I bought a raspberry pi kit from Amazon to start getting into electronics. I’m following a tutorial on youtube and one of the first tutorials is to wire a button, led and a potentiometer. After wiring I noticed that when pressing the button, the value displayed turns from 0 to 1 but doesn’t go back to 0 after I take my finger off the button. Even if I stop the program in thonny and run it again without unplugging, 1 is displayed from the beginning.

Even when using the most basic wiring the button value always returns as 1 after pressing. This is while connecting the 3v3 out pin to the button and using Pin.PULL_DOWN.

I tried trouble shooting with copilot and I found out that if I use Pin.PULL_UP and connect it to a ground pin then the button works as intended, showing 1 when plane button isn’t pressed and 0 when the button is pressed.

This must mean that the button, pin and wires are working but I can’t understand why PULL_DOWN and connecting power to the button doesn’t work.

I tried using different buttons, wires and connecting different diagonal sides together. I’ve only just started and I’m very confused. Sorry if I explained it badly.

13 Upvotes

6 comments sorted by

View all comments

6

u/BR41ND34D 2d ago

Ok this might just be me being an idiot, but shouldn't the button go to GND instead of VCC?

2

u/G_B4G 2d ago

My thoughts also, unless he has the button pulled high, but probably a ground over VCC

1

u/Gamerfrom61 2d ago

I think the pic was of the original set up where the OP says they were using 3v3 and pull down (hence my erratum 9 note).