I have an array of 64-bit integers to display on an 8x8 led matrix
const int LEN1 = sizeof(Hours);
const uint64_t Hours[] = {
0x00043c3c3c3c3c00,
0x000c3c3c3c3c3c00,
0x001c3c3c3c3c3c00,
0x0000001818000000,
0x0000001818100000,
0x0000001818180000,
0x00000018181c0000,
0x000000181c1c0000,
0x0000001c1c1c0000,
0x0000041c1c1c0000,
0x00000c1c1c1c0000
};
and here I have a loop to display it:
void displayImage(uint64_t image) {
for (int i = 0; i < 8; i++) {
byte row = (image >> i * 8) & 0xFF;
for (int j = 0; j < 8; j++) {
lc.setLed(0, i, j, bitRead(row, j));
}
}
}
but I can't use a loop in this way and I'm not proficient in byte shifting principles too.
can you please explain how the loop above works or help me to write this loop as
const int LEN1 = sizeof(Hours);
void displayImage(Hours[]) {
for (int i = 0; i < LEN1; i++) {
//display Hours
}
}