Blink example

The "blink example" does not run continuously loop. Can anyone tell me why?

/*
Blink

Turns an LED on for one second, then off for one second, repeatedly.

Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:

modified 8 May 2014
by Scott Fitzgerald
modified 2 Sep 2016
by Arturo Guadalupi
modified 8 Sep 2016
by Colby Newman

This example code is in the public domain.

*/

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(10000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for a second
}

How long did you wait? Your code has the LED on for 10-seconds, not 1-second.

If you post it in code tags like you are supposed to, people can download it and test it.

Upload your program and then watch it for one minute and report back what you see.

You've programmed this into your Arduino (right?)

Turn on the Arduino and watch it for one minute. What do you see?

kenmcgrath662:
I did load the "Blind" example. I saw it blink once with no looping.

I loaded your sketch into my Uno and saw the LED stay on for 10-seconds, go out for 1/2-second and then come back on and it repeated this pattern.

Try this:

void setup() 
{
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  
}


// the loop function runs over and over again forever
void loop() 
{
    digitalWrite(LED_BUILTIN, HIGH);    // turn the LED on (HIGH is the voltage level)
    delay(500);                         // wait for 1/2-second
    digitalWrite(LED_BUILTIN, LOW);     // turn the LED off by making the voltage LOW
    delay(500);                         // wait for 1/2-second
}

What do you see?

I don't know how to upload the program other than copy it.

Please follow the advice on posting a programming question given in Read this before posting a programming question

In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless

Are you looking at the right LED?

Try this. Open a new sketch using the File->New from the IDE Menu. It should look like this:

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

Upload it to your board. What do you see when it runs? Does the same LED blink?

kenmcgrath662:
aarg,
I don't understand. Those void statements are the same in the "Blink" example.

No, they aren't. They contain no code. Why not do as I say? I suspect you will see that the LED flashes even when the sketch is empty.

Both programs -- the one you originally posted and the one I slightly modified for you -- run on my Uno and Mega and the LED does blink.

The LED activity you are seeing on your board initially is probably the RX and TX LEDs that light when the IDE is talking to the MCU during programming.

I can only surmise your board (what are you using?) has a damaged LED or the pin is damaged so you cannot see the looping action. Do you have anything connected to your board, anything connected to pin '13'?

Do you know how to open the serial monitor? If you're not familiar with it yet, try reading this:

Load and program this program into your Arduino:

void setup() 
{
    pinMode( LED_BUILTIN, OUTPUT );
    Serial.begin(9600);
    
}//setup

void loop() 
{
    Serial.println( "On" );
    digitalWrite( LED_BUILTIN, HIGH );
    delay(500);
    
    Serial.println( "Off" );
    digitalWrite( LED_BUILTIN, HIGH );
    delay(500);
    
}//loop

And open the serial monitor and make sure the baud rate is set to 9600. Do you see any LEDs on the board blinking and do you see text scrolling on the serial monitor?

Perhaps it's not the end. Is it a genuine Arduino or a clone? Have you tried substituting "13" for "LED_BUILTIN"? What happens when you connect an external resistor/LED to pin 13? Did you ever connect pin 13 to anything external before, that might have overloaded the pin?

After all, the on board LED isn't useful for much when the Arduino is functioning as a controller...

whoa there!
The onboard LED is very useful...
In almost every one of my projects, I even add a LED if necessary as an ACTIVITY indicator, or heartbeat LED to show the loop() is running.

I admit I don't understand what happened here. How could you see the RX and TX LEDs but not the built-in LED 3 millimeters away?

Anyway, good luck with your future Arduino ventures.

Huh. Chalk up "wasn't looking at the right LED" as a new newbie issue.

On the bright side - W00T! You built and uploaded a sketch to your Arduino, and it totally fricking works! Yay!