🛠 Faire clignoter la LED de la Feather nRF52840
Objectives
Get started with the Adafruit Feather nRF52840 Express: install the "Adafruit nRF52 Boards" Arduino core, select the *Adafruit Feather 52840* board, compile to the board, and blink the user LED. The nRF52840 is a Nordic SoC (Cortex-M4F 64 MHz, 1 MB flash, 256 KB RAM) in Feather format; the red LED is controlled by the LED_BUILTIN constant defined by the BSP, which avoids the conflict in Adafruit documentation (Express page: "Pin #3", Sense page: "Pin #13").
Hardware
- 1× Adafruit Feather nRF52840 Express
- 1× micro-USB cable with data lines (charge-only cables prevent both serial port access and UF2 mode — a pitfall explicitly documented by Adafruit)
- PC with Arduino IDE 2.x and the "Adafruit nRF52 Boards" core (≥ 1.1.x) installed via the Board Manager
Complete Code
// nrf52840-clignotement-led.ino — core Adafruit nRF52 Boards
void setup {
pinMode(LED_BUILTIN, OUTPUT); // LED rouge, broche définie par le BSP
Serial.begin(115200); // USB CDC natif : aucune puce FTDI/CP210x sur la carte
}
void loop {
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
Serial.println("Feather 52840 : LED toggle");
delay(500);
}
Expected Verification
The red LED blinks every 500 ms and the serial monitor (115200 baud) displays the messages. Double-click the RST button: the NeoPixel turns green and the FTHR840BOOT drive appears — proof that the UF2 bootloader is alive (useful for reflashing via drag-and-drop).
Common Errors
- Charge-only cable: no COM port or UF2 mode — change the cable before anything else.
- Wrong board selected: you must select *Adafruit Feather 52840*, not an AVR Feather board.
- Hard-coded LED pin (3 or 13): Adafruit pages contradict each other, always use
LED_BUILTIN. - Missing core: without "Adafruit nRF52 Boards" in the Board Manager, compilation fails on
LED_BUILTIN.
Other tutorials for this board
Code examples for this board
neopixel_pulsation.pyPythonled_bouton.pyPythonentrees_num.pyPythonanalogique_lumiere.pyPythonservo_pwm.pyPythonscanner_i2c.pyPython