Blink | Arduino Documentation

Turn an LED on and off every second.

Overview

Added

March 17, 2026

Subject & domain

computer-science-advanced · embedded-systems

Grade range

Grade 5–Grade 12 (Senior)

Page kind

Tutorial

Introduction

  • Objective: Learn to blink the on-board LED, the simplest physical output task for an Arduino.
  • Hardware Requirements: Arduino board, optional external LED, and a 220-ohm resistor.
  • Key Constant: LED_BUILTIN is used to reference the built-in LED pin, which varies by board (most commonly D13).
  • Circuit Safety: A resistor is required when using an external LED to limit current and prevent damage to the board or LED.
  • Ohm's Law Application: Use $V = IR$ to calculate the appropriate resistor value based on board voltage (5V or 3.3V) and LED forward voltage.
  • Core Code Functions:
    • pinMode(LED_BUILTIN, OUTPUT);: Initializes the pin.
    • digitalWrite(LED_BUILTIN, HIGH);: Turns the LED on (supplies voltage).
    • digitalWrite(LED_BUILTIN, LOW);: Turns the LED off (0 volts).
    • delay(1000);: Pauses the program for 1000 milliseconds (1 second).
  • Accessing the Example: Available in the Arduino IDE via File > Examples > 01.Basics > Blink.
  • Next Steps: The documentation recommends exploring BlinkWithoutDelay for non-blocking timing and DigitalReadSerial for input handling.
  • Last Revision: 2015/07/28.

Community reviews

No published reviews yet. Be the first to share your experience.