High signal detected although nothing is connected

Pi Pico. Hey today I was connecting on solderless board with Pico with button and LED making it turn on and off after pressing button. Yesterday it was working properly. Today I accidentally connected button to 3V3_EN instead of 3V3OUT. And LED was blinking although button wasn't pressed! I did reset by connecting RUN and GND. Also I drag&drop nuke flash uf2 and It didn't help. Now I made simple program (code below) that sends info to serial port when button is pressed. I connected pure Pico, nothing is connected to it and it still detects button pressed. What is going on here? What have i broken and how to fix it??? I use Arduino SDK and VS Code.

void setup() {

void loop() {
  auto state = digitalRead(15); 
  if(state==HIGH) { 
    Serial.println("Button pressed"); 

Is your board working well, if you connect it correctly. Then it is possible that nothing is broken.
I don't know PI Pico, but some boards have resistors that rise pin voltages to HIGH.
Usually, a button at the input needs also resistor on that same input. Then it is possible that an input is always HIGH or LOW without a button or switch.
It is also possible that software connects internal resistors to pins. In general if an input has nothing connected to it, it may read random things or even always HIGH or LOW.

use INPUT_PULLUP if you want the pin not to be floating (which leads to random reads)

a Serial.begin() would probably be useful too

Please do yourself a favour and please read How to get the best out of this forum (I added code tags to your post for this time...)

Thank you for help! INPUT_PULLUP didn't work however INPUT_PULLDOWN does it! I'm very newbie at it and completely don't know what means PULLUP or PULLDOWN (Only that it is something with resistors). But the most important is that everything is working!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.