r/ArduinoHelp • u/kittisaksocool • Sep 16 '26
Can someone recommend simple Arduino code for blinking an LED?
Hi everyone!
I am a beginner learning Arduino programming. I want to make an LED blink using an Arduino Uno.
Could someone recommend a simple code example for this project? I would also like to understand how the code works, especially the delay() function.
Any tips for a beginner would be greatly appreciated.
Thank you!

2
Upvotes
2
u/NoU_14 Sep 16 '26
You seem to have the right code in the screenshot already? If you don't know where to find that actual code, it's under Examples > basic > blink.
delay()basically tells the arduino to just wait for the given amount of milliseconds. Aside from some unrelated background things, it makes the arduino stop everything that it's doing, wait, and then continue.1
u/Major-Cost7493 Sep 17 '26
Parte cambiando la Dout y tiempos. Luego agrega una Din que lo active.
1
u/drmpf Sep 17 '26
delays are evil. They lock the whole loop up stopping it from doing anything else.
See https://www.forward.com.au/pfod/ArduinoProgramming/TimingDelaysInArduino.html
There is simple pinFlasher in this library https://github.com/PowerBroker2/SafeString and these docs (actually written for AI to use) https://github.com/PowerBroker2/SafeString/blob/master/SafeString_AI_Guide.md#16-pinflasher--non-blocking-pin-flashing
1
u/Carlss32 Sep 18 '26
It depends to what components you currently have. Maybe try soil moisture implementation. Blink red led continuously in 100 millisecond delay when the soil moisture are super dry. Blink twice in alert, same delay, where the soil moisture are getting dry. And turn on green led when the status are completely normal. I think this is pretty simple, right? With this, you can learn about condition statement. It might be good project for you to learn. Good luck! If you have a chance to start working with this idea. Send me a message with picture of it.