#include <LedControl.h>

int DIN = 2;
int CLK = 3;
int CS = 4;

LedControl lc = LedControl(DIN, CLK, CS, 2);

unsigned char disp[10][8] = {
  {0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C},//0
  {0x10,0x30,0x50,0x10,0x10,0x10,0x10,0x7C},//1
  {0x3E,0x02,0x02,0x3E,0x20,0x20,0x3E,0x00},//2
  {0x00,0x7C,0x04,0x04,0x7C,0x04,0x04,0x7C},//3
  {0x08,0x18,0x28,0x48,0xFE,0x08,0x08,0x08},//4
  {0x3C,0x20,0x20,0x3C,0x04,0x04,0x3C,0x00},//5
  {0x3C,0x20,0x20,0x3C,0x24,0x24,0x3C,0x00},//6 
  {0x3E,0x22,0x04,0x08,0x08,0x08,0x08,0x08},//7
  {0x00,0x3E,0x22,0x22,0x3E,0x22,0x22,0x3E},//8
  {0x3E,0x22,0x22,0x3E,0x02,0x02,0x02,0x3E} //9
};

void setup() {
  for (int i=0; i<2; i++)
  {
    lc.shutdown(i, false);
    lc.setIntensity(i,0);
    lc.clearDisplay(i);
  }
}

void loop() {
  static int cnt=0;
  
  for (int i=0; i<10; i++)
  {
    for(int j=0; j<8; j++)
    {
      lc.setRow(0, j, disp[cnt][j]);
      lc.setRow(1, j, disp[i][j]);
      delayMicroseconds(10);
    }
    delay(1000);
  }
  cnt++;
  if (cnt >= 10) cnt =0;
}
