I'm coming back to arduinos after years of using esp32s of various types. With those, I'm used to just connecting one leg of a button to ground and the other to a digital pin. Works fine. Sometimes I use the built in pull up resistor or sometimes I add an external pull up or pull down one.
WIth Arduino, when I've tried doing this, I've ended up with a floating pin. Looking at diagrams, it seems with arduinos they almost always show one leg of the button connected to 5v as well...
Can it be that it's more complicated to wire up a button to an arduino and not have it float?! (I WAS using an external 10K pull down resistor, I had one leg of my button connected to ground but via a 10K resistor. The other leg was just pulled straight into a digital read pin. The only time the read was stable was when the button was being pushed otherwise it was just floating 010101010101010100111000101010101
But am I going mad?? Why would this be very doable on an ESP32 but not on an Arduino?
Am I missing something? Should I take a nap? Get back to my bath chair?
That's because most of those diagrams were drawn by beginners who can't get their heads around a pin reading LOW instead of HIGH when the button is pressed, or don't know about internal pull-ups.
Sounds like you didn't enable the internal pull-up. The 10K was doing nothing useful.