Integrated Graphics: UNO R4 Matrix Dice
The UNO R4 Matrix Dice project showcases the power of the newest generation of Arduino boards. By using the built-in 12x8 LED matrix, you don't need any external displays or messy wiring to build a functioning digital game.

Designing the Matrix Frames
To show numbers 1 through 6, you must draw them first.
- You use the online Arduino Matrix Editor to click on the 12x8 pixel grid, drawing a single dot for '1', two diagonal dots for '2', etc.
- The editor generates Hexadecimal arrays (e.g.,
uint32_t dice_frame_1[] = {0x...}). You paste these arrays into your sketch. - When the user presses a button, the Arduino generates a random number and loads the corresponding frame:
matrix.loadFrame(dice_frame_4).
Required Hardware
- Arduino UNO R4 WiFi: The board with the built-in matrix.
- Push Button: To trigger the "Roll".
- 10k-ohm Pulldown Resistor.
True Randomness
To ensure the dice doesn't roll the exact same sequence every time you turn the board on, you use the randomSeed(analogRead(A0)) function in the setup(). This reads the fluctuating electrical noise from an empty analog pin to scramble the random number generator!