Blink example on pin 13 led does not work...

Hello!

I purchased an Arduino Uno today and was so happy, until I was going to upload my first program... The blink example on pin 13 led. :cry:

It does nothing! No blinking at all, not even once...

Is the pin 13 led broken or something?
Have I done something wrong?

Which Arduino did you buy? Did the program upload successfully?

pert:
Which Arduino did you buy? Did the program upload successfully?

Sorry, forgot to say that, Arduino Uno :slight_smile:

Yep, successfully uploaded the program

Try this slightly modded blink. Open the serial monitor and see if it tells you it's in setup() once then at the top of loop() each time through.

/*
  Blink
  Turns on 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 and
  Leonardo, it is attached to digital pin 13. If you're unsure what
  pin the on-board LED is connected to on your Arduino model, check
  the documentation at http://www.arduino.cc

  This example code is in the public domain.

  modified 8 May 2014
  by Scott Fitzgerald
 */


// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
  Serial.begin(9600);
  Serial.println("in setup()");
}

// the loop function runs over and over again forever
void loop() {
  Serial.println("in loop()");
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}
1 Like

Yep, I see the message setup() and then adds loop() message every second. The only thing blinking is TX, not the L

JimboZA:
Try this slightly modded blink. Open the serial monitor and see if it tells you it's in setup() once then at the top of loop() each time through.

/*

Blink
  Turns on 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 and
  Leonardo, it is attached to digital pin 13. If you're unsure what
  pin the on-board LED is connected to on your Arduino model, check
  the documentation at http://www.arduino.cc

This example code is in the public domain.

modified 8 May 2014
  by Scott Fitzgerald
*/

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
  Serial.begin(9600);
  Serial.println("in setup()");
}

// the loop function runs over and over again forever
void loop() {
  Serial.println("in loop()");
  digitalWrite(13, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

Connect another LED to pin 13 and try again.

OK well that at least tells us the board's not stuffed. The Tx will blink each time it does the Serial.println();

Next thing is to get a loose LED and resistor and put the anode into pin13 and the cathode to ground and see if it blinks, and / or try the same on another pin.

Hi All,

I have similar problem but on the Arduino Leonardo and Arduino Leonardo Eth. When I upload the example program the diode on the board is blinking but it seems that there is no voltage on the output pins. Because it is the same on both boards I suspect I'm missing something basic.
Boards are powered with the USB cable, they are new and I'm using latest IDE on Windows 7.

Any ideas what can be wrong?

Regards

waRBooz:
Any ideas what can be wrong?

Did you try my blink code with serial prints in, to see if the board is actually working?

I've uploaded the program sending messages thru serial port. I can see in_loop messages and the diode is blinking. Any idea why there is no voltage on the output pins?

Did anyone ever sort this one out? I have exactly the same problem with a Uno Wifi R2. Everything works as expected, built in LED blinks nicely on for 10s and off for 10s. An external LED+resistor work perfectly when connected between +5V and GND, but not when connected pin 13 to GND. Any ideas?
(Powering Uno from 12V DC input. Other sketches work OK and power other pins OK.)

siddyboy:
I have exactly the same problem with a Uno Wifi R2.

Please post your sketch.

Code below. Apart from a couple of jumper wires sticking out of pin 13 and the GND next to it (so I can probe with my DMM) there is no attached circuit. Same result regardless of power by USB or 12VDC input.

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_BUILTIN, CHANGE);
  delay(10000);
}

I have no experience with the 4809 micro on your board but the CHANGE looks odd to me

digitalWrite(LED_BUILTIN, CHANGE);

Have you tried the blink example in the IDE?

Note: the original thread was about an Uno (328P processor), not an Uno Wifi R2 (4809 processor).

Unlike the classic Uno, the builtin LED on the Uno WiFi is on pin 25:

#define LED_BUILTIN 25

So it's normal and expected that the external LED you connect to pin 13 won't be affected by code that uses LED_BUILTIN. You need to change LED_BUILTIN in your code to 13 to affect pin 13.

sterretje:
I have no experience with the 4809 micro on your board but the CHANGE looks odd to me

It looked odd to me too, and I was halfway through a reply explaining that it was wrong to do this, but I try to never assume I know what I'm talking about (since so often I don't), so I gave it a try, and it works! Turns out, this provides a toggle function:

We definitely need to document this.

Well, I learn something new every day!

I also did not assume :wink: That's why I phrased it carefully.

Thanks guys; setting the output pin to 25 works on the physical pin 13 on my Uno WiFi 2. The voltage on the pin is present, but, as expected, the built in LED doesn't flash so I guess I have to switch both to have them both flashing together.

For the enum CHANGE thing; see my previous question "Using boolean variables instead of HIGH/LOW in digitalWrite();"

Thanks again.

This is the one that worked for me thanks :smiley: :smiley: :smiley:

JimboZA:
OK well that at least tells us the board's not stuffed. The Tx will blink each time it does the Serial.println();

Next thing is to get a loose LED and resistor and put the anode into pin13 and the cathode to ground and see if it blinks, and / or try the same on another pin.

hi, I have the same problem here, the led on arduino uno board doesn't work although the loose led with resistor works. did anyone solve this problem?