🛠 Clignotement de la LED builtin (broche 13)
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
- 1 × Classic Arduino Nano (ATmega328P @ 16 MHz, 32 KB flash, 2 KB SRAM)
- 1 × USB Mini-B cable (original connector; micro-USB/USB-C clones accepted)
- Optional: 1 LED + 1 220 Ω resistor on a breadboard for an external setup
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
- Missing serial port: on a CH340 clone, install the WCH driver; on an official board, install the FTDI VCP driver.
- Uno board selected instead of Nano: the bootloader handshake fails, and the upload does not complete.
- Clone without a visible builtin LED: locate the small LED marked L, or wire an external LED + 220 Ω resistor to ground.
pinMode(LED, OUTPUT)forgotten: the LED remains barely lit, as the pin stays in input mode.
Other tutorials for this board
Code examples for this board
buzzer-melodie.inoArduinoservo-sweep.inoArduinoultrason-hcsr04.inoArduinolcd-i2c.inoArduinoeeprom-contre.inoArduinosommeil-watchdog.inoArduino