🛠 Clignotement de la LED builtin (broche 13)

Arduino Nano (Classic, ATmega328P) · debutant · Schéma : IMG-nano-classic-debutant-1-nanoc-blink-led.svg — Arduino Nano classique avec sa LED builtin sur la broche 13 et une LED externe optionnelle avec résistance 220 Ω

Objectives

The "builtin" LED on the classic Arduino Nano (pin 13, LED_BUILTIN constant in the core) is soldered onto the board: no external wiring is required. This first tutorial verifies that the board is alive, that the serial bootloader (original ATmegaBOOT, Optiboot on recent boards) accepts an upload via the FTDI link, and familiarizes you with the setup/loop pair.

Hardware

Complete code

// Clignotement de la LED builtin (broche 13)
const uint8_t LED = LED_BUILTIN;   // broche 13 sur Nano classique

void setup {
  pinMode(LED, OUTPUT);            // broche en sortie
}

void loop {
  digitalWrite(LED, HIGH);         // LED allumée
  delay(500);                      // 500 ms
  digitalWrite(LED, LOW);          // LED éteinte
  delay(500);                      // 500 ms
}

Expected verification

In the Arduino IDE, select the "Arduino Nano" board (ATmega328P) and the correct serial port (FTDI device on official boards, CH340 on clones), then upload. The LED blinks every 500 ms, even when disconnected from the PC: the program fits within the 32 KB flash (of which 1.5 KB is for the bootloader).

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials