🛠 Faire clignoter la LED RGB embarquée
Objectives
Discover the Arduino compilation and upload cycle on the Nicla Sense ME (ABX00050) by blinking the onboard RGB LED. A specific feature of this board: the SMLP34RGB2W3 LED is not connected to a standard GPIO pin; it is driven by a dedicated IS31FL3194 circuit (reference U8) connected via I²C to the nRF52832 microcontroller, and accessible through the Nicla_System library included with the core. The upload process itself is also unusual: the "Arduino Mbed OS Nicla Boards" pack does not use drag-and-drop of a .bin file; it flashes the board via OpenOCD and the CMSIS-DAP interface of the onboard USB bridge (SAMD11).
Hardware
- Arduino Nicla Sense ME board (ABX00050)
- Micro-USB data cable (note: some cables are charge-only)
- PC with Arduino IDE 2.x and the "Arduino Mbed OS Nicla Boards" board pack (v4.6.0 as of 2026-10-13)
Complete Code
#include "Nicla_System.h"
void setup {
Serial.begin(115200);
nicla::begin; // initialise l'alimentation système et l'accès aux puces
nicla::leds.begin; // démarre le pilote du circuit LED IS31FL3194
}
void loop {
nicla::leds.setColor(red); // rouge plein feu
delay(500);
nicla::leds.setColor(off); // extinction
delay(500);
}
Expected Verification
After uploading, the RGB LED blinks red once per second (500 ms on, 500 ms off). Replace red with green, blue, or white to verify the three channels of the driver. The serial console at 115200 baud remains available for any diagnostics; the serial port is routed by the SAMD11 USB bridge, not by the nRF52832 itself.
Common Errors
- Forgetting
nicla::begin: without this call, the power supply for system peripherals is not initialized, and the LED does not respond. - Wrong board pack selected: you must select "Arduino Mbed OS Nicla Boards" and then "Arduino Nicla Sense ME", not an AVR core.
- Upload failure if the sketch folder path contains a space (known bug ArduinoCore-mbed #1025): move the project to a path without spaces.
- Board not visible in the port list: the SAMD11 bridge may hang; unplug and replug the board. If a sketch blocks the processor, enter bootloader mode by double-tapping the reset button immediately after powering on.
Other tutorials for this board
Code examples for this board
led_rgb.inoArduinoimu_bhi260.inoArduinorotation_fusion.inoArduinopression_bmp390.inoArduinonose_electronique.inoArduinoboussole_bmm150.inoArduino