Skip to Content
This is the Beta version of our new Learning Paths approach. Please email feedback.

LED Matrix

The Arduino Ek R4 WiFi comes with a built-in LED Matrix with 8 rows and 12 columns, that can be programmed to display text, images, and animations.

Images and Animation

To use the display you need the LED Matrix library for the Ek R4 WiFi. This works by creating a frame and loading it into a buffer which displays the frame. A frame can be considered to be the image that is displayed at any given moment on the matrix. An animation is a series of frames shown in sequence.

The 8x12 LED matrix is controlled simply by setting the bit value to 0 or 1 to turn the pixel at that position off or on. The simplest approach is to make a two-dimensional array with 8 rows and 12 columns of 0s and 1s as shown below. If you look for the 1s you can see they are laid out to display a plus sign. You can then change any individual value to change the image or create an animation.

byte frame[8][12] = { { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 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, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 } };

While this is simple to understand it is not very practical to create meaningful images or animation with this approach. This also takes up more memory than required since each pixel needs a bit (0 or 1) whereas we are using an integer (8 bits). Arduino provides tools to help create images and optimize memory usage which you can look into. We will be only displaying text so we will not get into those details in our code.

Displaying Text

The LED Matrix supports printing characters via the additional ArduinoGraphics library.

Install Arduino UNO R4 Graphics Library