Arduino code will upload on the board but will not run


Is my arduino done?

You know that pin 13 is connected to the onboard LED?
Disconnect the external stuff, and see if the LED on the Uno blinks.

Please don't EVER post pictures of code.

Yeah but the led blink One time when i upload the code , it is it is meant to stay on the led and my bad

How many delays in your loop?

You never set pin 13 to output mode using pinMode().

What value resistor are you using? Do you have the LED connected properly - you can test this by connecting the wire to +5V instead of pin 13 to see if the LED lights.

1 Like

One

520 ohm but it works find without code and i have done that mby it is broken the Uno?

Maybe it's a missing pinMode, as noted above

The LED is likely very dimly lit all the time with the code you are using (@anon56112670 has pointed you toward the coding problem). The lack of pinMode() results in the digitalWrite() turning the internal pullup resistor on/off, effective driving the LED through a very high resistance.

i wrote digitalwrite instead of pinmode up in void setup :sweat_smile: thx dude

You never actually said what the problem was but that code will turn the LED on, wait one second, turn it off and then immediately turn it on again. From a visual perspective the LED will be permanently on.

ps., learn to use the tags please.

The output only stays low for 3.5microseconds before it goes high again.

Hi, @marc571b22
Welcome to the forum.

To add code please click this link;

As @JohnLincoln has explained.

Try this in your loop;

void loop()
{
digitalWrite(13, HIGH);  // turn on LED
delay(1000);                    // keep LED on for 1s
digitalWrite(13, LOW);  // turn off LED
delay(1000);                   // keep LED off for 1s
)

Tom.. :smiley: :+1: :coffee: :australia:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.