LED blink when set digitalWrite HIGH

void setup(){
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
  
}

void loop(){
  digitalWrite(13, HIGH);
}

I using this function to turn on my led. This program run on proteus very well. But when I upload this program to arduino nano, led blinking. :o :o :o :o

Any one help me to solve this problem

As per written code LED will be remain High.

Hello xpain

xpain:
But when I upload this program to arduino nano, led blinking. :o :o :o :o

When is the diode blinking? blinking for ever?

Regards,
bidouilleelec

bidouilleelec:
Hello xpain
When is the diode blinking? blinking for ever?

Regards,
bidouilleelec

When I using digitalWrite(LED, HIGH), led will be blink. Example:

loop(){
     digitalWrite(13, HIGH);
     delay(3000);
     digitalWrite(13, LOW);
     delay(3000);
}

Led will be blink in 3s and off in 3s

Are u using the correct resistor for the led?

I am not clear where you are stuck

Just setting the output HIGH will not make the LED blink, unless of course you use an LED with a built in blinking circuit

:confused: :confused: I am using 220 ohms resistor and white led. I also tried using a light bulb with a different resistor connection, but the phenomenon still occurs. I tried connecting both D6 and D13 pins. LOW makes the led off and HIGH makes the led blink.

Hi,
Where did you get the LED?

If you connect the LED and resistor to 5Vpin and gnd pin, what does the LED do?
It should light up and NOT flash, if it does flash, you have a flashing LED.

Tom... :slight_smile:

:frowning: :frowning: :frowning: I have a flashing LED. Thanks for all the help.