This library allows the interfacing of any Arduino board with one or more LED matrix modules controlled by MAX7219/MAX7221. Each module has 64 individual LEDs arranged in an 8 x 8 matrix. The maximum number of modules that can be controlled is 255. These can be arranged in the form of one row of 255 modules (matrix 8 x 2040 = 16320 pixels), or in two rows of 127 modules (matrix 16 x 1016 = 16256 pixels), or in three rows of 85 modules (matrix 24 x 680 = 16320 pixels), or whatever number of rows you want. Each LED in the matrix display can be addressed individually.
An example image of a MAX7219/MAX7221 Matrix Module commonly sold on the market can be seen in Figure 1. On the right side, there are 3 input pins (CLK, DS, and DIN respectively) to be connected to the controller and two more pins (GND and VCC) for the power supply. On the left side, there are 3 output pins (also CLK, CS, and DOUT) to be connected to other module inputs if the number of LEDs/pixels is to be increased. There are also two power supply pins (GND and VCC) to make connection easier.
Figure 1. MAX72xx LED Matrix Module
Table 1. MAX72xx LED Matrix Module configured as DMD_MAX72xx::TYPE_TBLR
⇩⇨ | Byte-0 | Byte-1 | Byte-2 | Byte-3 | Byte-4 | Byte-5 | Byte-6 | Byte-7 |
---|---|---|---|---|---|---|---|---|
bit-0 | O | O | O | O | O | O | O | O |
bit-1 | O | O | O | O | O | O | O | O |
bit-2 | O | O | O | O | O | O | O | O |
bit-3 | O | O | O | O | O | O | O | O |
bit-4 | O | O | O | O | O | O | O | O |
bit-5 | O | O | O | O | O | O | O | O |
bit-6 | O | O | O | O | O | O | O | O |
bit-7 | O | O | O | O | O | O | O | O |
Table 2. MAX72xx LED Matrix Module configured as DMD_MAX72xx::TYPE_TBRL
⇩⇦ | Byte-7 | Byte-6 | Byte-5 | Byte-4 | Byte-3 | Byte-2 | Byte-1 | Byte-0 |
---|---|---|---|---|---|---|---|---|
bit-0 | O | O | O | O | O | O | O | O |
bit-1 | O | O | O | O | O | O | O | O |
bit-2 | O | O | O | O | O | O | O | O |
bit-3 | O | O | O | O | O | O | O | O |
bit-4 | O | O | O | O | O | O | O | O |
bit-5 | O | O | O | O | O | O | O | O |
bit-6 | O | O | O | O | O | O | O | O |
bit-7 | O | O | O | O | O | O | O | O |
Table 3. MAX72xx LED Matrix Module configured as DMD_MAX72xx::TYPE_BTLR
⇧⇨ | Byte-0 | Byte-1 | Byte-2 | Byte-3 | Byte-4 | Byte-5 | Byte-6 | Byte-7 |
---|---|---|---|---|---|---|---|---|
bit-7 | O | O | O | O | O | O | O | O |
bit-6 | O | O | O | O | O | O | O | O |
bit-5 | O | O | O | O | O | O | O | O |
bit-4 | O | O | O | O | O | O | O | O |
bit-3 | O | O | O | O | O | O | O | O |
bit-2 | O | O | O | O | O | O | O | O |
bit-1 | O | O | O | O | O | O | O | O |
bit-0 | O | O | O | O | O | O | O | O |
Table 4. MAX72xx LED Matrix Module configured as DMD_MAX72xx::TYPE_BTRL
⇧⇦ | Byte-7 | Byte-6 | Byte-5 | Byte-4 | Byte-3 | Byte-2 | Byte-1 | Byte-0 |
---|---|---|---|---|---|---|---|---|
bit-7 | O | O | O | O | O | O | O | O |
bit-6 | O | O | O | O | O | O | O | O |
bit-5 | O | O | O | O | O | O | O | O |
bit-4 | O | O | O | O | O | O | O | O |
bit-3 | O | O | O | O | O | O | O | O |
bit-2 | O | O | O | O | O | O | O | O |
bit-1 | O | O | O | O | O | O | O | O |
bit-0 | O | O | O | O | O | O | O | O |
Table 5. MAX72xx LED Matrix Module configured as DMD_MAX72xx::TYPE_LRTB
⇨⇩ | bit-0 | bit-1 | bit-2 | bit-3 | bit-4 | bit-5 | bit-6 | bit-7 |
---|---|---|---|---|---|---|---|---|
Byte-0 | O | O | O | O | O | O | O | O |
Byte-1 | O | O | O | O | O | O | O | O |
Byte-2 | O | O | O | O | O | O | O | O |
Byte-3 | O | O | O | O | O | O | O | O |
Byte-4 | O | O | O | O | O | O | O | O |
Byte-5 | O | O | O | O | O | O | O | O |
Byte-6 | O | O | O | O | O | O | O | O |
Byte-7 | O | O | O | O | O | O | O | O |
Table 6. MAX72xx LED Matrix Module configured as DMD_MAX72xx::TYPE_LRBT
⇨⇧ | bit-0 | bit-1 | bit-2 | bit-3 | bit-4 | bit-5 | bit-6 | bit-7 |
---|---|---|---|---|---|---|---|---|
Byte-7 | O | O | O | O | O | O | O | O |
Byte-6 | O | O | O | O | O | O | O | O |
Byte-5 | O | O | O | O | O | O | O | O |
Byte-4 | O | O | O | O | O | O | O | O |
Byte-3 | O | O | O | O | O | O | O | O |
Byte-2 | O | O | O | O | O | O | O | O |
Byte-1 | O | O | O | O | O | O | O | O |
Byte-0 | O | O | O | O | O | O | O | O |
Table 7. MAX72xx LED Matrix Module configured as DMD_MAX72xx::TYPE_RLTB
⇦⇩ | bit-7 | bit-6 | bit-5 | bit-4 | bit-3 | bit-2 | bit-1 | bit-0 |
---|---|---|---|---|---|---|---|---|
Byte-0 | O | O | O | O | O | O | O | O |
Byte-1 | O | O | O | O | O | O | O | O |
Byte-2 | O | O | O | O | O | O | O | O |
Byte-3 | O | O | O | O | O | O | O | O |
Byte-4 | O | O | O | O | O | O | O | O |
Byte-5 | O | O | O | O | O | O | O | O |
Byte-6 | O | O | O | O | O | O | O | O |
Byte-7 | O | O | O | O | O | O | O | O |
Table 8. MAX72xx LED Matrix Module configured as DMD_MAX72xx::TYPE_RLBT
⇦⇧ | bit-7 | bit-6 | bit-5 | bit-4 | bit-3 | bit-2 | bit-1 | bit-0 |
---|---|---|---|---|---|---|---|---|
Byte-7 | O | O | O | O | O | O | O | O |
Byte-6 | O | O | O | O | O | O | O | O |
Byte-5 | O | O | O | O | O | O | O | O |
Byte-4 | O | O | O | O | O | O | O | O |
Byte-3 | O | O | O | O | O | O | O | O |
Byte-2 | O | O | O | O | O | O | O | O |
Byte-1 | O | O | O | O | O | O | O | O |
Byte-0 | O | O | O | O | O | O | O | O |
Figure 2. Interfacing MAX72xx LED Matrix Module with AVR board
Figure 3. Interfacing MAX72xx LED Matrix Module with ESP8266 board
Figure 4. Interfacing MAX72xx LED Matrix Module with STM32 board
Figure 5. Cascading MAX72xx LED Matrix Module in one row
Figure 6. Cascading MAX72xx LED Matrix Module in multi rows