Hello.
I need work with led panels 64*64, HUB75E, 1/32 Scan. I have read a post about it and seem current Smartmatrix code do not support yet this kind of panels.
I have check source code, to see if may I modify it to add support to HUB75E. Seem there are 3 source files to modify, MatrixHardware_KitV1.h, SmartMatrix.h and SmartMatrix_Impl.h.
.
1.- Modify in MatrixHardware_KitV1.h need add the 5th pin (E) to Scan 1/32, so something like this:
#define ADDX_PIN_0 3
#define ADDX_PIN_1 4
#define ADDX_PIN_2 1
#define ADDX_PIN_3 2
#define ADDX_PIN_4 zz // Must replace zz for the hardware pin to assing in Arduino, I must to check yet what pin use
#define ADDX_PIN_MASK ( (1 << ADDX_PIN_0) | (1 << ADDX_PIN_1) | (1 << ADDX_PIN_2) | (1 << ADDX_PIN_3) | (1 << ADDX_PIN_4) )
.
2.- Modify in SmartMatrix.h
#define SMARTMATRIX_HUB75_32ROW_MOD16SCAN 0
#define SMARTMATRIX_HUB75_16ROW_MOD8SCAN 1
#define SMARTMATRIX_HUB75_64ROW_MOD32SCAN 2
#define CONVERT_PANELTYPE_TO_MATRIXPANELHEIGHT(x) ( (x == SMARTMATRIX_HUB75_32ROW_MOD16SCAN ? 32 : 0) |
(x == SMARTMATRIX_HUB75_16ROW_MOD8SCAN ? 16 : 0) | (x == SMARTMATRIX_HUB75_64ROW_MOD32SCAN ? 64 : 0) )
#define CONVERT_PANELTYPE_TO_MATRIXROWPAIROFFSET(x) ((x == SMARTMATRIX_HUB75_32ROW_MOD16SCAN ? 16 : 0) |
(x == SMARTMATRIX_HUB75_16ROW_MOD8SCAN ? 8 : 0) | (x == SMARTMATRIX_HUB75_64ROW_MOD32SCAN ? 32 : 0) )
#define CONVERT_PANELTYPE_TO_MATRIXROWSPERFRAME(x) ((x == SMARTMATRIX_HUB75_32ROW_MOD16SCAN ? 16 : 0) |
(x == SMARTMATRIX_HUB75_16ROW_MOD8SCAN ? 8 : 0) | (x == SMARTMATRIX_HUB75_64ROW_MOD32SCAN ? 32 : 0) )
.
3.- Modify in SmartMatrix_Impl.h
// fill addressLUT
for (i = 0; i < matrixRowsPerFrame; i++) {
// set all bits that are 1 in address
addressLUT[i].bits_to_set = 0x00;
if (i & 0x01)
addressLUT[i].bits_to_set |= (1 << ADDX_PIN_0);
if (i & 0x02)
addressLUT[i].bits_to_set |= (1 << ADDX_PIN_1);
if (i & 0x04)
addressLUT[i].bits_to_set |= (1 << ADDX_PIN_2);
#ifdef ADDX_PIN_3
if (i & 0x08) addressLUT[i].bits_to_set |= (1 << ADDX_PIN_3);
#endif
#ifdef ADDX_PIN_4
if (i & 0x16) addressLUT[i].bits_to_set |= (1 << ADDX_PIN_4);
#endif
// set all bits that are clear in address
addressLUT[i].bits_to_clear = (~addressLUT[i].bits_to_set) & ADDX_PIN_MASK;
}