Arduino LED Blink Tutorial – How to Blink an LED Using Digital Pin 2
Introduction One of the first projects every Arduino beginner learns is the LED Blink project. It is simple, easy to understand, and helps you learn the basics of programming and controlling electronic components using an Arduino board. In this tutorial, we will connect an LED to Digital Pin 2 of an Arduino Uno and make it blink continuously. Components Required Arduino Uno LED 220Ω Resistor Breadboard Jumper Wires USB Cable Circuit Connection Connect the components as follows: Arduino Digital Pin 2 → 220Ω Resistor → LED Positive (Long Leg) LED Negative (Short Leg) → Arduino GND The resistor is important because it limits the current flowing through the LED and protects it from damage. Arduino Code const int ledPin = 2; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, HIGH); delay(1000); digitalWrite(ledPin, LOW); delay(1000); } Code Explanation 1. Define the LED Pin const int ledPin = 2; This line tells Arduino that the LED is connected t...