🛠 Faire clignoter la LED 13 d'une Duemilanove (et choisir le bon ATmega)

Arduino Duemilanove — Board Fiche · debutant · Schéma : IMG-duemilanove-debutant-1-clignoter-led-13-duemilanove.svg — Arduino Duemilanove vue de dessus, puce ATmega DIP-28 et puce FTDI FT232RL annotées, LED marquée L près de la broche 13 surlignée, câble mini-USB branché, sélecteur IDE « Duemilanove w/ ATmega328 » en encart.

Objectives

Get started with the Arduino Duemilanove (2009), the last major "old-school" board before the Uno: an 8-bit AVR ATmega168 or ATmega328 running at 16 MHz, 5 V logic, FTDI FT232RL USB-to-serial bridge, and ATmegaBOOT bootloader. The first program is a classic — blinking the LED on pin 13 — but it hides THE historical pitfall of this board: there are two different chips behind the same board name, and you must select the correct one in the IDE.

Hardware

Full code

// Blink Duemilanove — LED integree broche 13 (HIGH = allumee)
const byte LED = 13;

void setup {
  pinMode(LED, OUTPUT);
}

void loop {
  digitalWrite(LED, HIGH);   // LED allumee
  delay(1000);
  digitalWrite(LED, LOW);    // LED eteinte
  delay(1000);
}

In the IDE: Tools > Board > Arduino Duemilanove or Diecimila, then Tools > Processor: select "ATmega328" if your chip is a 328 (or 328P), or "ATmega168" if it is a 168. Select the serial port (the FTDI USB-to-serial port, never a Bluetooth port) and Upload.

Expected verification

The "L" LED blinks once per second as soon as the upload finishes. The board's TX/RX LEDs blink during the upload (USB traffic via the FTDI chip). The program continues to run without USB, powered by a 7–12 V jack supply or a battery connected to the Vin/GND pins on the POWER connector.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials