🛠 Faire clignoter la LED utilisateur
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
- 1 Arduino MKR WAN 1300 board
- 1 micro-USB data cable
- PC with Arduino IDE and the "Arduino SAMD Boards" core
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
- Wrong board selected: bossac fails, check for "mkrwan1300".
- Charge-only cable: no serial port appears.
- LED off: test another pin and update the SAMD core.
Other tutorials for this board
Code examples for this board
emission-p2p.inoArduinoreception-p2p.inoArduinoreglage-sp.inoArduinometeo-lora.inoArduinotrame-crc.inoArduinorelais-radio.inoArduino