Skip to content

UNO R4 LED matrix #10

@mkobetic

Description

@mkobetic

The board has a neat built-in 12x8 LED matrix https://docs.arduino.cc/tutorials/uno-r4-wifi/led-matrix/. There isn't really any sophisticated circuitry supporting it. The LEDs are simply connected to 11 GPIO pins in a configuration called charlieplexing, that allows lighting up individual LEDs with combinations of the 11 pins. More details can be found here https://forum.digikey.com/t/theory-behind-the-arduino-uno-r4-wifi-12-x-8-led-display-matrix/43827.

The Arduino library for this is fairly rudimentary https://github.com/arduino/ArduinoCore-renesas/blob/main/libraries/Arduino_LED_Matrix/src/Arduino_LED_Matrix.h

The solution could be a timed interrupt that will light up individual LEDs based on a bitmap in RAM. Since the LEDs can only be turned on one by one (in general case), each interrupt will take the next matrix position, turn on the corresponding LED as necessary (an off any others). With 96 LEDs and at 10 frames per second, the interrupt will need to fire about 1000 times per second. There might be a way to serve more than 1 LED per interrupt if the LED combination uses different wires.

I'd like to be able to scroll text across the matrix along the longer side, so it would probably be advantageous to organize the RAM frame buffer in columns, rather than rows. That also nicely side steps the issue of having to allocate 12 bits to bytes in some sensible manner. Given that the columns are 8bits tall, each byte is simply next column. The column structure alse nicely lends itself to scrolling, you can generate the row of columns as long as you want (with the full line of the text) and the simply move the frame buffer pointer along it at whatever speed you want.

I'm also wondering it the LEDs could be lit up at different brightness levels. It may not be feasible given the relatively short time each will be on (~ 1/96th of a second). But if it is, the interrupt could fire 4 times per LED and depending on four brightness levels turn the LED off sooner or later. Each LED will then need more bits in the framebuffer then.

Free bitmap ascii fonts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions