I was just on the Loop reference page:http://arduino.cc/en/Reference/Loop
When I tried the code example, I found the code wouldn't compile!
So I changed the code to this an it works!
Maybe someone should change that page to a working example?
int buttonPin = 3;
// setup initializes serial and the button pin
// loop checks the button pin each time,
// and will send serial if it is pressed
if (digitalRead(buttonPin) == HIGH)
I am in version 1.0.1 of Arduino, with an UNO board if that matters.
Perhaps the reference page is an old example?