Blink | Arduino Documentation

Turn an LED on and off every second.

Overzicht

Toegevoegd op

17 maart 2026

Vak & domein

computer-science-advanced · embedded-systems

Schooljaar

Groep 5–Klas 4

Paginatype

Tutorial

Inleiding

  • 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-recensies

Nog geen gepubliceerde recensies. Deel als eerste uw ervaring.