Below is a sketch for an Arduino Deumilanove. When I load the program, the LED on pin 13 comes on for moment and then the sketch works fine. Why the flash and how do I get rid of it? Thanks
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
const int led2pin =4;
int buttonState = 0;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
pinMode (led2pin, OUTPUT);
digitalWrite(ledPin, LOW);
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
digitalWrite(led2pin,LOW);
} else {
digitalWrite(led2pin,HIGH);
digitalWrite(ledPin, LOW);
}
}