Arduino Blink LED Tutorial: Circuit and Code
Turn the LED on, wait, turn it off, wait, and repeat forever. This is the “hello world” of electronics.
Parts you need
- Arduino Uno
- Red LED
- 220Ω resistor
Wiring
- Pin 13 → resistor → LED long leg
- LED short leg → GND rail
Arduino code
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}
Goal and tip
Goal: Make the LED blink at least twice.
Tip: Try this: change both 1000s to 200 for a fast blink. 1000 means 1 second.