🛠 Faire clignoter la LED RGB embarquée

Arduino Nicla Sense ME · debutant · Schéma : IMG-nicla-sense-me-debutant-1-niclasense-clignotement-led.svg — Nicla Sense ME vu de dessus, LED RGB SMLP34RGB2W3 entourée, câble micro-USB vers l'ordinateur, puce pilote IS31FL3194 indiquée sous la LED

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

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

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials