int num [10][7] = {0,0,0,0,0,0,1,
                  1,0,0,1,1,1,1,
                  0,0,1,0,0,1,0,
                  0,0,0,0,1,1,0,
                  1,0,0,1,1,0,0,
                  0,1,0,0,1,0,0,
                  0,1,0,0,0,0,0,
                  0,0,0,1,1,1,1,
                  0,0,0,0,0,0,0,
                  0,0,0,0,1,0,0};
int Segpin[8]={2,3,4,5,6,7,8};
void setup() {
  // put your setup code here, to run once:
  for(int i=0; i<9; i++){
    pinMode(Segpin[i], OUTPUT);
  }
}
void loop() {
  // put your main code here, to run repeatedly:
  for(int i=0; i<=9; i++){
    show_num(i);
    delay(1000);
  }
}
void show_num(int a){
  for(int i=2; i<=9; i++){
    digitalWrite(i,num [a] [i-2]);
  }
}