Arduino LED Circuit: Wiring and Code for Beginners

Every circuit starts with one light. Send power from pin 13 through a resistor to the LED and switch it on.

Parts you need

Wiring

  1. Pin 13 → resistor → LED long leg
  2. LED short leg → GND rail

Arduino code

void setup() {
  pinMode(13, OUTPUT);
  digitalWrite(13, HIGH);
}

void loop() {
  // nothing to repeat
}

Goal and tip

Goal: Make the LED glow.

Tip: Try this: change HIGH to LOW and run again. What happens?

Run this experiment in the free simulator