// Display 9999 to 0 in loop with dealy, do not display the prefix 0
void setup() {
// put your setup code here, to run once:
volatile char *dirf,*dirk,*dira,*dirc;
volatile char *outf,*outk,*outa,*outc;
volatile long a[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x67};
volatile long b[]={0xBF,0x86,0xDB,0xCF,0xE6,0xED,0xFD,0x87,0xFF,0xE7};
volatile long i,j,k,k1,k2;
dirf = 0x30; outf = 0x31;
dirk = 0x107; outk = 0x108;
dira = 0x21; outa = 0x22;
dirc = 0x27; outc = 0x28;
k=9;
while(k>=1)
{
k1=9;
while(k1>=0)
{
k2=9;
while(k2>=0)
{
for(i=9;i>=0;i--)
{
*outf=a[k];
*outk=a[k1];
*outa=a[k2];
*outc=a[i];
for(j=0;j<20000;j++);
}
k2--;
}
k1--;
}
k--;
}
*outc=0x00;
k=9;
while(k>=1)
{
k1=9;
while(k1>=0)
{
for(i=9;i>=0;i--)
{
*outf=a[k];
*outk=a[k1];
*outa=a[i];
for(j=0;j<20000;j++);
}
k1--;
}
k--;
}
*outa=0x00;
k=9;
while(k>=1)
{
k1=9;
while(k1>=0)
{
for(i=9;i>=0;i--)
{
*outf=a[k];
*outk=a[k1];
for(j=0;j<20000;j++);
}
k1--;
}
k--;
}
*outk=0x00;
for(i=9;i>=0;i--)
{
*outf=a[i];
for(j=0;j<500000;j++);
}
*outf=0x00;
}
void loop() {
// put your main code here, to run repeatedly:
}