Hi,
I'm trying to set up a simple circuit with a button so that I can read the state of the button using a digital I/O port. I followed this official Arduino tutorial. I believed I had set up the electronics correctly and I copied the code directly from the tutorial. Despite this the LED that was supposed to respond to the input value fluctuated between on and off randomly leading me to believe that the pull down resistor was not working and the value off the pin was floating. To test this theory I printed the input value of the port using Serial.println() in the following code.