#include <LedControl.h>
const int DIN_PIN = 7;
const int CS_PIN = 6;
const int CLK_PIN = 5;
const uint64_t IMAGES[] = {
0x0000000000000200,
0x0000000000000600,
0x0000000000010600,
0x0000000001010600,
0x0000000201010600,
0x0000040201010600,
0x0000040201090600,
0x0008040201090600,
0x0008140201090600,
0x0008142201090600,
0x0008142241090600,
0x0008142241490600,
0x0008142241492600,
0x0008142241493600,
0x0008142241593600,
0x0008142241793600,
0x0008142251793600,
0x0008142271793600,
0x0008142279793600,
0x0008143279793600,
0x0008143a79793600,
0x00081c3a79793600,
0x00081c3e79793600,
0x00081c3e7d793600,
0x00081c3e7d7d3600,
0x00081c3e7f7d3600,
0x00081c3e7f7f3600,
0x00081c3e7f7d3600,
0x00081c3e7d7d3600,
0x00081c3e7d793600,
0x00081c3e79793600,
0x00081c3a79793600,
0x0008143a79793600,
0x0008143279793600,
0x0008142279793600,
0x0008142271793600,
0x0008142251793600,
0x0008142241793600,
0x0008142241593600,
0x0008142241493600,
0x0008142241492600,
0x0008142241490600,
0x0008142241090600,
0x0008142201090600,
0x0008140201090600,
0x0008040201090600,
0x0000040201090600,
0x0000040201010600,
0x0000000201010600,
0x0000000001010600,
0x0000000000010600,
0x0000000000000600,
0x0000000000000000
};
const int IMAGES_LEN = sizeof(IMAGES)/8;
LedControl display = LedControl(DIN_PIN, CLK_PIN, CS_PIN);
void setup() {
display.clearDisplay(0);
display.shutdown(0, false);
display.setIntensity(0, 10);
}
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++) {
display.setLed(0, i, j, bitRead(row, j));
}
}
}
int i = 0;
void loop() {
displayImage(IMAGES[i]);
if (++i >= IMAGES_LEN ) {
i = 0;
}
delay(500);
}