Simple Button Input Floating Problems - New User

only a newbee, but here's my guess.

I assume that the button is a simple contact type button, so unless the button is pressed, there is no pull up or pull down resistor on pins 2 or 3.

From my understanding ( very limited ) you need to pull the pins 2 and 3 to either high, with the buttons connecting Gnd to the pin, or pull pins 2 and 3 to low with the buttons connecting 5V+ to the pins.

In either case, you don't need a resistor in series from the button to the pin, as you're passing the boards own 5V+ (or Gnd) back to the pin.

I would move the resistor to connect the pin 2 and 3 to the 5V+, and then join Gnd to the button, and the other side of the button to the pin.

I could be wrong, in fact quite possible, but this is my 0.02c based on my understanding.