led_rgb.ino
Counterintuitive but documented: the Nicla Sense ME RGB LED goes through an IS31FL3194 I2C driver, not digitalWrite. The Nicla_System library exposes nicla::leds.setColor(color) — the board official status-lamp idiom.
Hardware
An Arduino Nicla Sense ME (nRF52832, BLE only) with Bosch BHI260AP hub, BMM150, BMP390, BME688 sensors, RGB LED on an I2C driver and LiPo charger. The board alone, on USB or LiPo. The RGB LED is on-board, visible through the housing.
Wiring
No wiring. The I2C driver is internal; do not wire LEDs on the digital pins without a buffer (the manual rates those I/Os low-current).
How it works
nicla::begin powers the VDDIO_EXT rail and unlocks the drivers; nicla::leds.begin initializes the IS31FL3194; setColor applies predefined colors (red, green, blue, yellow, white, black = off).
Running it
Programmed from the Arduino IDE (ArduinoCore-mbed); Arduino_BHY2 and Nicla_System libraries; USB through a serial bridge.
Variants
Map a state (BLE connected = blue, low battery = red), blink by timing between setColor calls, or drive brightness through the driver register API.
led_rgb.ino
// Nicla Sense ME : la LED RVB n'est PAS sur des broches GPIO.
// Elle est pilotée par un circuit IS31FL3194 (I2C) exposé par la
// bibliothèque Nicla_System sous nicla::leds.
#include "Nicla_System.h"
void setup() {
Serial.begin(115200);
nicla::begin(); // alimente VDDIO_EXT, rend les pilotes accessibles
nicla::leds.begin(); // initialise le pilote LED IS31FL3194
}
void loop() {
nicla::leds.setColor(green); delay(500); // « alive »
nicla::leds.setColor(blue); delay(500);
nicla::leds.setColor(red); delay(500);
nicla::leds.setColor(yellow); delay(500);
nicla::leds.setColor(white); delay(500);
nicla::leds.setColor(black); delay(500); // éteinte
}