Pages: [1]   Go Down
Author Topic: Noob Question with LED Blinking  (Read 476 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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() {

}


Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 241
Posts: 24480
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't use pin 13 - it is also used by the bootloader.
Just pick another pin.
Logged

"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.

Pages: [1]   Go Up
Jump to: