I am a beginner at Arduino; I started about 1 month ago, though I have prior coding experience.
I tried making a simple circuit that accomplishes the following task: when a button is pressed, a message is printed to the Serial monitor in the Arduino IDE. However, I couldn't get this to work, and I'm not sure why.
The circuit is very simple: a jumper wire goes from the Arduino's digital pin #1 to J30 on the breadboard. On the breadboard, the button is placed on the pins D28/30 and F28/30, which means that the two rows of connected legs in the button are on rows 28 and 30 respectively. Finally, a jumper wire goes from J28 to the Arduino's GND Pin.
However, when I ran the code, the circuit behaved strangely. When I pushed down on the button, nothing happened, but as soon as I let go of the button after pushing down on it, the Serial Monitor was flooded with the Serial.println statements.
Then, whenever I pressed down on the button again, the Serial statements would temporarily stop, but once I let go of the button, they continued to appear.
Why is the circuit behaving in this way? What should I do to fix it?