First of all you need to have some items

1.ardino  2.breadboard  3.special breadboard wire or some wiers   4.a led

next, you need to connect your Arduino to a pc and open the Arduino software 

now lest start coding

first you must open the ardino software then click on new to create a new project

So that’s the code I will start talking about what is the codes and how to work

okay if you look at the code a bit you will see this (int led =4;) so this is an int to set the output port for this project I set it on port 4

 

next, we must go to void setup if you don’t know what is void setup if you put a command in void start Arduino will do the command only 1 time

 

okay now let’s go in void setup in void setup we will see (pinMode(led, OUTPUT)) as you see in this command you can set a port to be what you can set a port to be output or input, and also if you remember the int we defined and we putten 4 in it so with this command it will put port 4 as an output port

next, we must go to void loop if you don’t know what void loop does as you see it will do the commands are in it forever it never stops so if it goes to the last command it will again go to the first command and start doing it so it will do the commands until you turn off the Arduino (this won’t affect your Arduino)

 

Inside the void loop the first command is (digitalWrite(led, HIGH);) this will set the port to ON (5V) if you put (LOW) instead of HIGH it will set the port to off (0V)

The next and last thing we see is (delay(1000);) if you put this between two commands it will go to the next command with 1000 millisecond delay or timer if you look at the code as you see between digitalWrite(led, HIGH) and digitalWrite(led, LOW) we have a delay so it will turn off the led with a 1000 millisecond delay or timer you can change the time by changing 1000 to any number you like.

Wiring

first of all do the wiring like the picture you see in blow and your led will blink

Check out these also