Built-in project · Arduino Uno R4 WiFi
Uno R4 WiFi heart
A heart beating on the Uno R4 WiFi’s 12 x 8 LED matrix, drawn through Arduino_LED_Matrix.h with no parts to wire. The whole build, an Arduino Uno R4 WiFi, runs here in your browser on the firmware below; open it in the editor to change the wiring or the code and run it again.
Runs in your browser. Free, and no account needed.
Click to open it in the editor
The circuit itself, running here on the simulator. Press what can be pressed; click anything else to open it in the editor.
The code
The firmware exactly as the editor opens it. Change a line there and press Run: it compiles in the browser.
sketch.ino · Arduino Uno R4 WiFi
// Matrix: a heart on the Uno R4 WiFi's 12 x 8 LED matrix, beating.
//
// The picture is eight rows of twelve, written the way it looks: a 1 is a lit
// LED. renderBitmap() hands it to the library, and the library does the hard
// part in the background: the matrix is ninety-six LEDs on only eleven pins,
// so it lights one pin's worth at a time, a millisecond each, faster than an
// eye can follow. Nothing on the board remembers the picture; the sketch just
// changes it.
//
// The LED on pin 13 blinks with the beat, so the two lamps show the same
// thing: one on its own pin, one ninety-sixth of a charlieplexed panel.
#include "Arduino_LED_Matrix.h"
ArduinoLEDMatrix matrix;
const uint8_t BIG[8][12] = {
{0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
};
const uint8_t SMALL[8][12] = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
};
void setup() {
Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);
matrix.begin();
Serial.println("a heart on the LED matrix");
}
void loop() {
matrix.renderBitmap(BIG, 8, 12);
digitalWrite(LED_BUILTIN, HIGH);
delay(400);
matrix.renderBitmap(SMALL, 8, 12);
digitalWrite(LED_BUILTIN, LOW);
delay(600);
}
Parts list
1 part, plus the jumper wires. Every one is in the editor's parts bin.
Change it and keep it
Open it in the editor, change the circuit or the code, and keep your version in a free account.