CCNAP

TPL-01Templates/LED Blink

LED Blink

The Hello World of Arduino. Blinks an external red LED on pin 13 on and off every second.

Open in Playgroundbeginner · LED · digital output
beginner

FIG. 1LED Blink · circuitTPL-01

02Sketch

sketch.inoArduino C++
16 lines
// LED Blink — wire a red LED + 220Ω resistor to pin 13 and GND.

const int LED_PIN = 13;

void setup() {
  pinMode(LED_PIN, OUTPUT);
  Serial.begin(9600);
  Serial.println("Blink started!");
}

void loop() {
  digitalWrite(LED_PIN, HIGH);  // turn LED on
  delay(1000);                   // wait 1 second
  digitalWrite(LED_PIN, LOW);   // turn LED off
  delay(1000);                   // wait 1 second
}

03Components

  • 01Arduino Uno
  • 02LED (red)
  • 03Resistor 220Ω

04Wiring

Component pinArduino pin
Resistor Pin 1Pin 13
LED Anode (+)Resistor Pin 2
LED Cathode (−)GND

All templates

Ready when you are

Have a circuit in mind?

No hardware, no installs — a browser is enough.