Hello
I am currently getting started with Arduino. I am building Some Projects of Massimo Banzis "Getting Started with Arduino" Book.
In the very simple "Using a Pushbutton to Control the LED" Example, he wires the Arduino to the button as shown in the schema. http://screencast.com/t/tfi6Rdx9kKB
My Question:
Why do we need the resistor and its connection to GND. After all, when we close the button, the borad should "sense" the voltage which is coming from the 5V Pin?
Yes, you do need the resistor. Without it, the Arduino input will be "floating", that is, not connected to anything. The voltage on the pin will be undefined, and could float high (5V) or low (0V). If it floats, you'll get false triggering of your sketch code (the software will sense that the button is pressed, when it isn't).
It might help to think of the resistor like the spring in the pushbutton. Without the spring, the button will not pop back out when you let go. It might stay in, it might drag back out again. But with the spring, you can be sure that the button will pop back out as soon as you let go. The resistor performs a similar function for the voltage on that input pin.
So the resistor allows the input pin to be connected to the ground when the button is open. If it wasn't, it would be "undefined" and could float. Thanks for your explaination, Anachrocomputer!