#include <LedControl.h>
// Pin configuration for the LED matrix
const int dataIn = 12;
const int clk = 11;
const int load = 10;
const int numDevices = 1; // Number of 8x8 matrices
LedControl lc = LedControl(dataIn, clk, load, numDevices);
// Character bitmaps (example for letters A, B, C, and D)
const byte name[5][8] = {
{
0b00110000,
0b01111000,
0b11001100,
0b11001100,
0b11111100,
0b11001100,
0b11001100,
0b00000000
},{
0b01111110,
0b00110010,
0b00110010,
0b00111110,
0b00110110,
0b00110010,
0b01110010,
0b00000000
},{
0b11001100,
0b11001100,
0b11001100,
0b11001100,
0b11001100,
0b11001100,
0b11111100,
0b00000000
},{
0b11000110,
0b11100110,
0b11110110,
0b11011110,
0b11001110,
0b11000110,
0b11000110,
0b00000000
},{
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000
}
};
// Define the message to display (indices correspond to the font array)
const int message[] = {0, 1, 2, 3,4}; // Displaying characters A, B, C, D
const int messageLength = sizeof(message) / sizeof(message[0]);
void setup() {
// Initialize the LED matrix
for (int i = 0; i < numDevices; i++) {
lc.shutdown(i, false); // Wake up displays
lc.setIntensity(i, 8); // Set brightness level (0 is min, 15 is max)
lc.clearDisplay(i); // Clear display
}
}
void loop()
{
for (int i = 0; i < messageLength; i++)
{
for (int j = 0; j < 8; j++)
{
lc.setRow(0, j, name[i][j]);
}
delay(1000);
}
}