🛠 Faire clignoter une LED avec la Particle Boron

Particle Boron · debutant · Schéma : IMG-particle-boron-debutant-1-boron-clignotement-led.svg — Particle Boron alimentée par micro-USB, LED externe sur broche D7 avec résistance, états allumé/éteint.

Objectives

The Particle Boron is an IoT board in the Adafruit Feather form factor, based on an nRF52840 (Cortex-M4F 64 MHz, 1 MB flash, 256 KB RAM) with an LTE-M cellular module. It is programmed in C/C++ using the Particle Device OS Wiring API. This first tutorial validates your development chain: firmware compiled, flashed via USB, and executed on the board. You will learn how to configure a pin as an output (pinMode), turn it on and off (digitalWrite), and add delays (delay), by controlling an external LED and the embedded status RGB LED.

Hardware

Complete Code

// Boron — clignotement LED (Particle Device OS 4.x LTS)
const uint16_t LED_PIN = D7;   // broche GPIO libre de votre choix (D2-D8 en PWM)

void setup {
    pinMode(LED_PIN, OUTPUT);
    RGB.control(true);        // prend le contrôle de la LED RVB embarquée
}

void loop {
    digitalWrite(LED_PIN, HIGH);
    RGB.color(255, 0, 0);     // rouge = LED allumée
    delay(500);
    digitalWrite(LED_PIN, LOW);
    RGB.color(0, 0, 80);
    delay(500);
}

Compile and flash via USB: particle flash <device_name> . (or the Flash button in VS Code). The board should restart with your firmware.

Expected Verification

The external LED blinks at 1 Hz (500 ms on, 500 ms off) and the board's RGB LED follows the color change. The USB serial port is available for Serial.print if you add it. This is the basic test: if it works, your environment is ready for the following tutorials.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials