clignotante.ino

Arduino UNO R4 WiFi · File : clignotante.ino · Language : Arduino · Use case : Faire clignoter la LED utilisateur du R4

The verification blink on the RA4M1: LED_BUILTIN and millis() behave as on AVRs, the USB monitor shows the trace. First test after an upload, before any electronics.

Hardware

An Arduino UNO R4 WiFi (Renesas RA4M1 @ 14 MHz + companion ESP32-S3 Wi-Fi/BLE, 12x8 LED matrix, RGB LED) powered by USB or 6-24 V. No external component.

Wiring

Nothing to wire: the user LED is built in (the 12x8 matrix and the RGB LED are separate outputs).

How it works

The loop compares millis() with the last toggle and flips LED_BUILTIN every second, tracing to serial at 9600 baud.

Running it

Arduino IDE 2.x with the « Arduino UNO R4 Boards » core, « Arduino UNO R4 WiFi » board, serial port then Upload. The ESP32-S3 coprocessor updates separately if the IDE asks.

Variants

On the R4 WiFi, replace with a blink of the internal RGB LED (WS2812 driver) in red/green, or two external LEDs.

clignotante.ino

// Clignotement sur l'UNO R4 : LED_BUILTIN pointe vers la LED
// utilisateur (la LED RGB est pilotee par le WS2812 interne).
const long PERIODE = 1000;

bool etat = false;
unsigned long dernier = 0;

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(9600);
  Serial.println(F("UNO R4 : clignotement demarre"));
}

void loop() {
  if (millis() - dernier >= PERIODE) {
    dernier = millis();
    etat = !etat;
    digitalWrite(LED_BUILTIN, etat);
    Serial.println(etat ? F("ON") : F("OFF"));
  }
}

← Back to the board