🛠 Faire clignoter la LED utilisateur

Arduino MKR WiFi 1010 · debutant · Schéma : IMG-mkr-wifi-1010-debutant-1-mkrwifi-blink-led.svg — Vue de dessus de la MKR WiFi 1010 avec la LED utilisateur D6 (LED_BUILTIN), la LED ON sur le rail 5 V et la LED RGB directionnelle mises en évidence.

Objectives

Discover the MKR WiFi 1010 board by blinking the user LED, and understand which of the three LEDs you are controlling: the user LED is connected to pin D6 (LED_BUILTIN = 6), the ON LED is simply tied to the 5 V rail (not controllable), and a directional RGB LED is onboard. This is the starting point of the entire series.

Hardware

Complete code

// Clignotement de la LED utilisateur (D6) de la MKR WiFi 1010.
const uint8_t LED = LED_BUILTIN;  // = 6 sur cette carte

void setup {
  pinMode(LED, OUTPUT);
  Serial.begin(115200);
}

void loop {
  digitalWrite(LED, HIGH);
  Serial.println("LED ON");
  delay(200);
  digitalWrite(LED, LOW);
  delay(800);
}

Expected verification

In the Arduino IDE, select the "Arduino MKR WiFi 1010" board and the corresponding port, then upload. The user LED blinks in a short/long rhythm (200 ms ON, 800 ms OFF) and Serial.println scrolls at 115200 bauds in the serial monitor. The first upload may trigger a "1200 bauds" (touch) reset specific to the SAMD bootloader: this is normal.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials