🛠 Faire clignoter la LED embarquée
Objectives
Discover the Arduino MKR NB 1500 board (Microchip ATSAMD21G18A, Arm Cortex-M0+ 48 MHz, 256 KB flash / 32 KB RAM), install the SAMD core, and blink the onboard LED, wired to pin D6 (LED_BUILTIN, physical pin PA20).
Hardware
- 1 Arduino MKR NB 1500 board (no antenna or SIM card required for this tutorial)
- 1 micro-USB data cable (the board uses the SAMD21 native USB, VID 0x2341 / PID 0x8055)
- Arduino IDE with the “Arduino SAMD Boards (32-bit ARM Cortex-M0+)” package installed via the Board Manager
Complete code
// Clignotement LED embarquee — MKR NB 1500
const uint8_t LED = LED_BUILTIN; // D6 (PA20)
void setup {
pinMode(LED, OUTPUT);
}
void loop {
digitalWrite(LED, HIGH);
delay(200); // 0,2 s allumee
digitalWrite(LED, LOW);
delay(1800); // 1,8 s eteinte
}
Expected verification
Select “Arduino MKR NB 1500” in Board Types, then upload: the LED on D6 blinks 0.2 s on / 1.8 s off. The upload uses the SAM-BA bootloader (bossac tool); the COM port may disappear and then reappear during the operation, which is normal.
Common errors
- Wrong board type (do not confuse with MKR GSM 1400 or MKR WiFi 1010, same form factor).
- Charge-only micro-USB cable: no serial port appears — try another cable.
- Confusing the red power LED (stays on even on battery, a known power consumption issue) with the user LED on D6.
- After a failed upload, double-click the reset button quickly to force entry into bootloader mode.
Other tutorials for this board
Code examples for this board
attente-lte-nbiot.inoArduinochoix-bande.inoArduinopublish-mqtt-minimal.inoArduinoeconomie-energie.inoArduinogeoloc-cellules.inoArduinotest-coverage.inoArduino