clignotante.ino
The go-to sanity check: the LED on pin 13 blinks at 1 Hz. millis() replaces delay() to keep the loop free. If nothing blinks, suspect the upload or the board selection.
Hardware required
An Arduino Micro (ATmega32U4, 16 MHz, 5 V) in a breadboard-friendly format with a micro-USB connector and native USB (keyboard/mouse). No external component: the onboard user LED is enough.
Wiring
Nothing to wire, the LED sits on pin 13 behind a current-limiting resistor.
How it works
Each loop pass compares millis() with the last change; after 500 ms the pin state flips. In the Arduino IDE, select « Arduino Micro » and the port, then Upload. On Windows a .inf driver may be needed for the COM port. Since the 32U4 is the USB itself, a bad sketch can lock out reflashing (double reset).
Going further
Vary PERIODE, or add an external LED with a 330 Ω resistor on another pin. Sur 32U4, la LED 13 clignote aussi pendant l'énumération USB.
clignotante.ino
// Clignotement de la LED integree (broche 13, alias LED_BUILTIN).
const long PERIODE = 500; // ms entre deux changements d'etat
bool etat = false;
unsigned long precedent = 0;
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
Serial.println(F("Clignotement demarre"));
}
void loop() {
unsigned long t = millis();
if (t - precedent >= PERIODE) {
precedent = t;
etat = !etat;
digitalWrite(LED_BUILTIN, etat ? HIGH : LOW);
Serial.println(etat ? F("ON") : F("OFF"));
}
}