Blinking LED problem.

Hello, I am a beginner and I recently realized a very simple circuit for blinking a led. The state of the led must change every second. But in my circuit the led stays on without blinking. How can I fix that ?

led.ino (134 Bytes)

You could maximise your chances of getting help by posting your code (don't forget the code tags) and a schematic.

You need a delay after it goes low, else it goes back to the top of loop and turns on so quickly, it doesn't seem to go off.

Thank you but I still have a problem. The led lights up then after one second then the brightness becomes very low and the LED keeps this state.

If you changed the code, post it again! This time like AWOL told you :wink:

Sorry! I forgot to post the new code.

led.ino (147 Bytes)

1_____1:
Sorry! I forgot to post the new code.

Work fine for me!

septillion:
If you changed the code, post it again! This time like AWOL told you :wink:

Reading is hard, isn't it? ::slight_smile:

Except from the crappy formatting I see nothing wrong.

Any reason why you want to reinvent the wheel? Because blink is the default program on an Arduino and the first in examples...

1_____1:
Sorry! I forgot to post the new code.

You forgot to read the instructions!

Ok thanks to all, everything works now! :slight_smile:

1_____1:
Ok thanks to all, everything works now! :slight_smile:

So what did you change? Your new code worked for me, but not for you, so what happened that it works all of a sudden?

I unplugged and reconnected my arduino card to my PC then the led
correctly worked.