I want to connect four Buttons on my Arduino board, concretely on the digital input pins 2 – 5. Following /arduino.cc/en/Tutorial/Button I have connected the parts as shown in the upper part of the attached image (next post). However, as soon as one button is closed, the input is distributed to any of the input pins.
I have also tried to connect the parts as shown in the lower part of the attached image (next post). However, as soon as a digital input pin is not attached to ground (if the button is closed) the input value on the pin is completely undetermined (why? I don't understand that)
I hope someone can help me.