breadboard
docs

Example project · Start here

Arduino Uno R4 blink

Official ArduinoCore-renesas firmware runs on the real emulated RA4M1 and drives the solved 5 V D13 net. The board art includes the live cycle-observed 12×8 matrix and real D13, TX, RX and power lamps.

The Arduino Uno R4 blink circuit as rendered by the simulator

How it works

This is Arduino's Blink sketch on the Arduino UNO R4 WiFi. The firmware is built with the official ArduinoCore-renesas and runs on an emulated Renesas RA4M1, a 48 MHz Arm Cortex-M4. setup() makes D13 an output. loop() sets it HIGH, waits 500 ms, sets it LOW and waits 500 ms, so the pin completes one cycle every second.

What this bench adds to the onboard blink is an external circuit. D13 is a node in the solved circuit, driven at 5 V logic. A 1 kΩ resistor and a green LED run from D13 to GND, so the LED current, a few milliamps, comes from the circuit solver rather than from a lamp that copies the pin state. The board's own D13 lamp follows the same pin, and the TX, RX and power lamps on the board art show real signals too. The 12 × 8 LED matrix is live as well, although this sketch leaves it dark.

What to watch

The green LED and the board's D13 lamp turn on and off together, half a second each. Probe D13 in Scope: with USB power, the square wave goes from about 0 V to about 4.6 V and repeats every second.

What's on the bench

  • Arduino Uno R4
  • LED
  • Resistor

How it's wired

  • Arduino Uno R4 · d13→Resistor · a
  • Resistor · b→LED · a
  • LED · k→Arduino Uno R4 · gnd2

The code

This Arduino C++ sketch lives in Code; sign in and press Compile & upload to build real firmware for the emulated board.

// Official-core UNO R4 WiFi Blink fixture. Edit it, then compile
// through the fixed arduino:renesas_uno:unor4wifi server target.
void setup() {
  pinMode(13, OUTPUT);
}

void loop() {
  digitalWrite(13, HIGH);
  delay(500);
  digitalWrite(13, LOW);
  delay(500);
}

Firmware licence

Notice: this firmware uses the LGPL-licensed Arduino core library

arduino-unor4wifi-blink.bin is statically linked with ArduinoCore-renesas 1.6.0, in Breadboard's port of its UNO R4 WiFi variant to Renesas FSP 5.3.0. Parts of that core are licensed under the GNU Lesser General Public License, version 2.1 or (at your option) any later version ("the Library"). Breadboard distributes this firmware under terms that permit you to modify the work for your own use and to reverse engineer it for debugging such modifications.

Try this

  • Open Code, change both delays to delay(100), then sign in and press Compile & upload. Both LEDs now blink five times a second.
  • Select the resistor and change it to 220 Ω. The green LED gets brighter, because more current flows.
  • Move the resistor’s wire from D13 to D12, add pinMode(12, OUTPUT) in setup(), and add digitalWrite(12, LOW) after D13 goes HIGH and digitalWrite(12, HIGH) after D13 goes LOW. Compile & upload to see the LEDs alternate.

Related projects