I'm connecting a button to ESP8266. Connection goes like this: 3v to one side of button, other side connected with GND and pin number 2 (no resistor).
Every time I connect the ESP both built in LED's stay on until I press the button, they turn off until I let go (even though code states otherwise). Plus, When I monitor the serial, gibberish runs while ignoring my print commands, until I press the button then the serial stops outputting altogether.
When I run the serial without the button, everything works fine. Am I connecting it wrong, or is the button damaged, or any other problem source? Thanks in advance.
EDIT: I added the pinMode(BTN_PIN, INPUT_PULLUP) to take the resistor role; to the code, still not helping.