Got a Pico W sitting on a breadboard with four little tactile switches and one LED, and the two buttons on the lower rows just refuse to register. The other two work fine, so I'm scratching my head. My program looks right to me, wich makes me suspect the physical side, but honestly I don't know where to start pulling things apart. When a button does nothing, is your first move to swap it with a known good one, or do you write a tiny test sketch that just prints pin states over and over? I keep going back and forth on which tells you more faster. Also curious whether people generally wire switches to ground with pull-ups enabled, or run them to 3.3V with a resistor. I've seen both argued for and I can't decide if it even matters for something this simple. And how much do you blame the breadboard itself? Those spring contacts seem like they can get tired, especially after a button has been reseated a few times. whould love to hear how you all chase these down.
Debugging dead buttons - do you trust the code first or the wiring first?
Oct 22, 2026
Last reply: 27 minutes ago
6 Replies
First reply
I always do the test program first, before touching a single wire. A five-line loop that prints every pin state once a second has saved me hours of pointless rewiring, because half the time the problem is that I am reading the wrong GPIO number in the code and the hardware was…
Read the full replyI always do the test program first, before touching a single wire. A five-line loop that prints every pin state once a second has saved me hours of pointless rewiring, because half the time the problem is that I am reading the wrong GPIO number in the code and the hardware was fine all along. Print the raw state of all four switches and watch it while you press each one. If two of them never budge while the other two toggle happily, then you can start swapping parts with confidence. On pull-ups versus pull-downs, I run everything to ground with the internal pull-ups enabled, purely because it means one less resistor on the board. It works exactly the same electrically either way, so pick whichever matches how you already wired the working buttons and keep the whole board consistent. Breadboards do wear out, though usually on the power rails rather than in the middle rows where switches live. What kills button contacts more often in my experiance is the legs of the tactile switches themselves, which are just slightly narrower than the holes on some breadboards, so the contact is intermittent from the start. Wiggling the switch gently while watching your serial output will show you right away wheather the connection is the problem. Also worth checking the leg orientation on those four-pin switches, since the pins are paired internally and it is surprisingly easy to have it rotated 90 degrees so both legs sit on the same side and the switch does nothing no matter what you press.
I'm the opposite on the order of operations. I grab the multimeter before I write anything. Put the meter across the switch legs in continuity mode, press the button, listen for the beep. Ten seconds per switch and you know instantly whether the button itself is dead. I had a batch of cheap tact switches off a marketplace seller where two out of ten had bent internal contacts straight out of the bag, and no amount of code was ever going to read them. Because two of your four work in the same rows, I would physically swap a working button into a dead position before anything else. If the fault follows the button, bin it. If it stays with the position, it is the board row or the jumper, and wiggling the jumper ends often makes it flare back to life on a serial print.
On the wiring question, I run mine to ground with the internal pull-ups enabled on the Pico. Fewer parts on the breadboard means fewer points of failure, and it saves resistors for other things. I know some folks prefer external pulldowns so the idle state is explicit, but for a hobby board I have never found it worth the extra columns.
As for the breadboard, yes, they wear out. I have an old one where the power rails went intermittent and drove me mad for an evening before I figured it out. Fresh row, fresh jumper, that fixes more ghosts than people expect.
One thing that cracked a stubborn button for me was a single spare jumper lead. I clipped it from the pin straight to ground, which fakes a press without touching the switch at all. If the pin reads low with the jumper but not when I press the button, the problem is between the pin and the switch, so wiring or the breadboard row. If it never reads low either way, it is the code or the pin itself. Took me two minutes and ended an hour of swapping parts around.
Check whether your two dead buttons share the same ground column or rail segment. I did this exact build last month and both my problem buttons were wired to a section of the rail that had no jumper back to the Pico ground pin. Moved one jumper and they both came alive instantly. Also worth counting rows on the breadboard, I once had my code watching GPIO 15 while the wire was actually in the row for 13, everything looked right and nothing worked.
Been wiring buttons since the days when you soldered your own pull-up resistors onto stripboard, so I go to ground with the internal pull-ups out of habit. Never had it bite me. One other thing to eyeball: on the four-leg tact switches it is dead easy to push a leg in at an angle and have it fold back under the body. Looks seated, reads open forever. Pull one of the dead ones back out and check all four legs are actually visible and straight before you blame anything else.
Something similar happened to me with a little button that felt like it was clicking but did nothing. Turned out the two legs on one side were allready connected inside the switch, so the way I had it turned on the board meant pressing it changed nothing at all. I spun it a quarter turn and it worked right away. So now I always try both pairs of legs before blaming the part. Does your board have room to just flip the two dead ones around without pulling everything apart?
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required