Go Down

Topic: Noob Question with LED Blinking (Read 595 times) previous topic - next topic

T-Hong

So I'm very new at this, and want to run the LED for 10 seconds, then off for 10 seconds then on for 10, then off for good.

The problem I'm having is that when I upload the code to the Arduino Uno, before the program runs, the LED blinks once no matter what channel I use. I want to apply this code to sequence a motor, and I can't have the motor blip at the beginning of the program. Is there any way around this? Thanks in advance.

void setup() {               
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);     
  digitalWrite(13, HIGH);   // set the LED on
  delay(10000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(10000);              // wait for a second
  digitalWrite(13, HIGH);   // set the LED on
  delay(10000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
}

void loop() {

}



AWOL

Don't use pin 13 - it is also used by the bootloader.
Just pick another pin.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up