🛠 Faire clignoter la LED embarquée et la LED RGB

Arduino Nano ESP32 · debutant · Schéma : IMG-nano-esp32-debutant-1-nanoesp32-clignotement-led.svg — La carte Nano ESP32 avec la LED D13 et la LED RGB embarquées en évidence.

Objectives

Discover the Arduino Nano ESP32 board (ESP32-S3, u-blox NORA-W106 module) by blinking the onboard D13 LED (LED_BUILTIN) and animating the integrated RGB LED, whose pins are defined by the core: LED_RED = 14, LED_GREEN = 15, LED_BLUE = 16. No soldering is required: everything is onboard.

Hardware

Complete code

// Nano ESP32 : LED_BUILTIN = D13 ; RGB : LED_RED=14, LED_GREEN=15, LED_BLUE=16
void setup {
  Serial.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(LED_RED, OUTPUT);
  pinMode(LED_GREEN, OUTPUT);
  pinMode(LED_BLUE, OUTPUT);
}

void loop {
  digitalWrite(LED_BUILTIN, HIGH);
  analogWrite(LED_RED, 255);    // rouge
  Serial.println("phase 1 : rouge");
  delay(500);
  digitalWrite(LED_BUILTIN, LOW);
  analogWrite(LED_RED, 0);
  analogWrite(LED_GREEN, 255);  // vert
  delay(500);
  analogWrite(LED_GREEN, 0);
  analogWrite(LED_BLUE, 255);   // bleu
  delay(500);
  analogWrite(LED_BLUE, 0);
}

Expected verification

The D13 LED blinks at 1 Hz and the RGB LED cycles through red → green → blue. The serial monitor (115200 baud) displays the phases. If two COM ports appear (“USB” and “DFU”), select the “USB” port.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials