Arduino blinking LED project

AR-B1: Blinking LED Project using Arduino

This entry is part 1 of 13 in the series Arduino Basic Circuits

This code is used to blink the LED connected at pin-13 (LED_BUILTIN). This LED is marked as “L” on the Arduino UNO board. First type the code by creating new file in Arduino IDE, save the file and then upload it.

Required Material

Arduino UNO Board – 1, data cable – 1, Computer / Laptop – 1.

Working

When the given code is uploaded to the Arduino UNO board, the built-in LED connected at pin-13 starts blinking at a rate decided by delay() function. If you type delay(1000); it will blink at 1 second rate. If you type delay(2000); it will blink for 2 seconds and so on.

The Code

int LED = 13;

void setup()
{
  pinMode(LED,OUTPUT);
}

void loop()
{
  digitalWrite(LED,HIGH);
  delay(100);
  digitalWrite(LED,LOW);
  delay(100);
}

Procedure & Precautions

  1. First type the code correctly in Arduino IDE software.
  2. Then connect the Arduino board to computer through data cable and click on “Tools” menu.
  3. Then select “Arduino board” and respective “COM” Port.
  4. The upload the code in Arduino UNO board.
  5. Observe that the LED “L” on Arduino UNO board is blinking at a rate decided by your delay() function value.
image 18 Vidyasagar Academy
Share on your network!
Yash Vidyasagar
Yash Vidyasagar

Professor in Department of CS, Fergusson College, Pune. Researcher in Embedded Systems, Expert in Online/Offline Education, Creator of lots of projects for community solutions... ➤➤

0 0 votes
Article Rating
Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
1
0
Would love your thoughts, please comment.x
()
x