#include <LedControl.h>
LedControl lc = LedControl(10, 8, 9, 1);
// From https://xantorohara.github.io/led-matrix-editor/
const uint8_t IMAGES[][8] = {
{ 0b00000000, 0b00011000, 0b00011000, 0b00111000, 0b00011000, 0b00011000, 0b00011000, 0b01111110},
{ 0b00000000, 0b00111100, 0b01100110, 0b00000110, 0b00001100, 0b00110000, 0b01100000, 0b01111110},
{ 0b00000000, 0b00111100, 0b01100110, 0b00000110, 0b00011100, 0b00000110, 0b01100110, 0b00111100},
{ 0b00000000, 0b00001100, 0b00011100, 0b00101100, 0b01001100, 0b01111110, 0b00001100, 0b00001100},
{ 0b00000000, 0b01111110, 0b01100000, 0b01111100, 0b00000110, 0b00000110, 0b01100110, 0b00111100},
{ 0b00000000, 0b00111100, 0b01100110, 0b01100000, 0b01111100, 0b01100110, 0b01100110, 0b00111100},
{ 0b00000000, 0b01111110, 0b01100110, 0b00001100, 0b00001100, 0b00011000, 0b00011000, 0b00011000},
{ 0b00000000, 0b00111100, 0b01100110, 0b01100110, 0b00111100, 0b01100110, 0b01100110, 0b00111100},
{ 0b00000000, 0b00111100, 0b01100110, 0b01100110, 0b00111110, 0b00000110, 0b01100110, 0b00111100},
{ 0b00000000, 0b00111100, 0b01100110, 0b01101110, 0b01110110, 0b01100110, 0b01100110, 0b00111100}
};
const int IMAGES_LEN = sizeof(IMAGES)/8;
void setup()
{
lc.shutdown(0, false);
lc.setIntensity(0, 15);
lc.clearDisplay(0);
}
void loop()
{
int i, k, j;
for (k=0;k<10;k++) {
for (i = 0; i < 8; i++) { lc.setRow(0,i,IMAGES[k][i]); }
delay(1000);
}
for (k=0;k<10;k++) {
for (j=0;j<8;j++) {
for (i = 0; i < 8; i++) { lc.setRow(0,i,(IMAGES[k][i]<<j)|(IMAGES[(k+1)%10][i]>>8-j)); }
delay(150);
}
}
}