Hi all,
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
void setup()
{
Serial.begin(9600);
pinMode(buttonPin, INPUT);
}
// loop checks the button pin each time,
// and will send serial if it is pressed
void loop()
{
if (digitalRead(buttonPin) == HIGH)
Serial.write('H');
else
Serial.write('L');
delay(1000);
}
I am in version 1.0.1 of Arduino, with an UNO board if that matters.
Perhaps the reference page is an old example?