🛠 Faire clignoter la LED embarquée (et comprendre les LED TX/RX)

Arduino Micro · debutant · Schéma : IMG-micro-debutant-1-micro-clignotement-led.svg — Vue de dessus d'une Arduino Micro avec la LED de la broche 13 (LED_BUILTIN) mise en évidence et les LED TX/RX près du connecteur micro-USB

Objectives

Make the Arduino Micro's onboard LED blink and understand a specific feature of the Micro: the TX/RX LEDs near the USB port indicate USB (CDC) traffic, not the state of pins 0/1 as on an Uno.

Hardware

Complete Code

// Clignotement de la LED embarquee (broche 13) sur Arduino Micro.
// Les LED TX/RX pres du connecteur USB suivent le trafic USB,
// pas digitalWrite : elles ne pilotent aucune broche.
void setup {
  pinMode(LED_BUILTIN, OUTPUT);   // broche 13
}

void loop {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(500);
  digitalWrite(LED_BUILTIN, LOW);
  delay(500);
}

Expected Verification

The LED on pin 13 blinks twice per second as soon as the upload finishes, even with the Serial Monitor closed. If you add Serial.begin(9600) and Serial.println calls, the TX/RX LEDs will also light up: this is CDC traffic, not pin 1.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials