void delaytime(int);
void delaytime1(int);
void setup() {
  // put your setup code here, to run once:
  volatile char *dirF,*dirk;
                 dirF=0x30;
                 *dirF=0xFF;
                 dirk=0x107;
                 *dirk=0xFF;
                
}

void loop() {
  // put your main code here, to run repeatedly:
    volatile long num[10]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x67};
  //volatile long num_with_decimal[10]={0xBF,0x86,0xDB,0xE6,0xED,0xFD,0x87,0xFF,0xE7};
  volatile long i,j,x;
  volatile char *outF,*outk;
                for(i=0;i<10;i++)
                {
                  
                  for(j=0;j<10;j++)
                  {
  
                 outF=0x31;
                 *outk=0x02;
                 outk=0x108;
                *outF=num[i];
               delaytime1();
                 
                //-----------------------
                outF=0x31;
                 *outk=0x01;
                 outk=0x108;
                *outF=num[j];
                 delaytime();
                 //-------------------------
                 outF=0x31;
                 *outk=0x02;
                 outk=0x108;
                *outF=num[i];
                delaytime1();
                  }
                  delaytime();
                  
                }
                 
                 

                 


}
               void delaytime()
                 {
                  volatile long i;
                  for(i=0;i<500000;i++);
                 }
                 void delaytime1()
                 {
                  volatile long i;
                  for(i=0;i<100000;i++);

                 }