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

Wiring

  1. Pin 13 → resistor → LED long leg
  2. 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.

Run this experiment in the free simulator