🛠 Faire clignoter la LED utilisateur

Arduino MKR WAN 1300 · debutant · Schéma : IMG-mkr-wan-1300-debutant-1-mkrwan-clignotement-led.svg — carte MKR WAN 1300 avec la LED utilisateur et le câble micro-USB en évidence

Objectives

Learn how to upload to the Arduino MKR WAN 1300 (Microchip SAMD21G18A, Arm Cortex-M0+ 48 MHz, 256 KB flash, 32 KB RAM) and blink the user LED. Note: this board has neither Wi-Fi nor Bluetooth; its only radio is a Murata CMWX1ZZABZ LoRa module (SX1272 + STM32L0), used in the following tutorials.

Hardware

Complete code

// LED utilisateur : LED_BUILTIN (D6, physique PB23).
// > 
void setup {
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(115200);        // USB natif, VID 0x2341
}

void loop {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(200);
  digitalWrite(LED_BUILTIN, LOW);
  delay(1800);
  Serial.println("tick");
}

Expected verification

Select the "Arduino MKR WAN 1300" board; the upload goes through the SAM-BA bootloader (bossac, "touch" reset at 1200 bauds). The LED blinks every 2 s and "tick" scrolls at 115200 bauds on the serial monitor.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials