Introduction
In this article, I will explain how to blink an LED in Arduino Mega 2560.
Parts Of List:
- Arduino Mega 2560
- LED-3
- Bread Board
- USB Cable.
LED:
- Light Emitting Diode (LED) can emit light.
- The LED glows when the voltage is applied

Figure 1: LED
- Positive pin = 13;
- Negative pin = Gnd.
Second LED connection:
- Positive pin = 12;
- Negative pin = Gnd.
Third LED connection:
- Positive pin = 11;
- Negative pin = Gnd.
Programming:
Explanation:
- int led1 = 13;
- int led2 = 12;
- int led3 = 11;
- void setup()
- {
- pinMode(13, OUTPUT);
- pinMode(12, OUTPUT);
- pinMode(11, OUTPUT);
- }
- void loop()
- {
- digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
- delay(1000); // wait for a second
- digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
- delay(1000); // wait for a second
- digitalWrite(12, HIGH); // turn the LED on (HIGH is the voltage level)
- delay(1000); // wait for a second
- digitalWrite(12, LOW); // turn the LED off by making the voltage LOW
- delay(1000); // wait for a second
- digitalWrite(11, HIGH); // turn the LED on (HIGH is the voltage level)
- delay(1000); // wait for a second
- digitalWrite(11, LOW); // turn the LED off by making the voltage LOW
- delay(1000); // wait for a second
- }
- When the first LED is ON then automatically take the delay time.
- And the second LED is ON and finally the third LED is also ON.
- It can be repeatedly done.
Output

Read more articles on Arduino:


Sr KarthigaPosted Feb 29, 2016, 2:47 PM EST
thank you asfend sir
Sr KarthigaPosted Feb 29, 2016, 2:47 PM EST
thank you asfend sir
Asfend YarPosted Feb 29, 2016, 9:21 AM EST
thnaks
Asfend YarPosted Feb 29, 2016, 9:21 AM EST
good and nice share
Sr KarthigaPosted Feb 16, 2016, 4:51 PM EST
Thank you santhakumar sir we will rock
Santhakumar MunuswamyPosted Feb 16, 2016, 10:01 AM EST
I wish you both ( Kumaresh, Sr Karthiga) have good future and continue your rocking contribution for IOT.
Santhakumar MunuswamyPosted Feb 16, 2016, 9:57 AM EST
Thanks for nice article
Sr KarthigaPosted Feb 15, 2016, 3:51 PM EST
Thank you Syed Shanu sir i was happy for your wishes
Kumaresh RajalingamPosted Feb 15, 2016, 3:29 PM EST
Nice share Karthiga
Syed ShanuTOP 100Posted Feb 15, 2016, 3:17 PM EST
Nice and happy to see more post from you.keep posting .Valthukal :)
Sr KarthigaPosted Feb 15, 2016, 2:54 PM EST
Thank you gowtham sir
Gowtham KTOP 100Posted Feb 15, 2016, 6:57 AM EST
Good One
Sr KarthigaPosted Feb 15, 2016, 2:13 AM EST
Thank you raja sir
Sr KarthigaPosted Feb 15, 2016, 2:13 AM EST
Thank you shubham sir
Sr KarthigaPosted Feb 15, 2016, 2:12 AM EST
thanh you shubham sir
Sr KarthigaPosted Feb 15, 2016, 2:12 AM EST
thank you sibeesh sir
Sr KarthigaPosted Feb 15, 2016, 2:12 AM EST
Thank you mohammed sir
Raja TPosted Feb 14, 2016, 10:00 PM EST
Greate,Thanks for sharing
Shubham KumarPosted Feb 14, 2016, 7:58 PM EST
Good work
Sibeesh VenuTOP 100Posted Feb 14, 2016, 7:35 PM EST
Nice Share
Mohammed IbrahimPosted Feb 14, 2016, 6:21 PM EST
nice
Sr KarthigaPosted Feb 14, 2016, 3:19 PM EST
Thank you kumaresh sir
Kumaresh RajalingamPosted Feb 14, 2016, 2:55 PM EST
Nice share Madam