🛠 Clignoter la LED embarquée D6
Objectives
Discover the Arduino MKR WAN 1310 board (Microchip SAMD21G18A, Arm Cortex-M0+ 48 MHz, 256 KB flash) by blinking the onboard LED D6, wired to pin 6 (LED_BUILTIN), and understand the difference with the ON LED.
Hardware
- 1 Arduino MKR WAN 1310 board + micro-USB cable
- No soldering required: the D6 LED is onboard (3.3 V logic)
Complete code
// Clignotement LED D6 (LED_BUILTIN = 6) — MKR WAN 1310
const int LED = LED_BUILTIN; // broche 6 selon la fiche technique
void setup {
pinMode(LED, OUTPUT);
Serial.begin(115200); // USB natif du SAMD21
while (!Serial); // attend l'ouverture du moniteur série
Serial.println("MKR WAN 1310 - blink D6");
}
void loop {
digitalWrite(LED, HIGH);
Serial.println("LED ON");
delay(200);
digitalWrite(LED, LOW);
delay(800);
}
Expected verification
The D6 LED blinks in short pulses (200 ms on, 800 ms off) and the serial monitor displays a message per cycle. Uploading uses bossac against the SAM-BA bootloader (reset by touching 1200 bauds).
Common errors
- Confusing D6 with the ON LED: the latter follows the 5 V rail and remains off when running on battery alone.
- Wrong board in the IDE: select "Arduino MKR WAN 1310" (ArduinoCore-samd core), never the MKR WiFi 1010.
- Forgetting
while (!Serial);and losing the first messages. - Reminders: this board has NEITHER Wi-Fi NOR Bluetooth; its only radio is LoRa/LoRaWAN (Murata CMWX1ZZABZ). It differs from the MKR WAN 1300 by its battery charger, 2 MB SPI flash, and improved power management.
Other tutorials for this board
Code examples for this board
join-otaa.inoArduinouplink-confirme.inoArduinodownlink.inoArduinoactivation-abp.inoArduinosuivi-adr.inoArduinoclasse-c.inoArduino