//06 Display 0.000 to 9.999 in loop with delay
void setup() {
// put your setup code here, to run once:
direction();
}
void loop() {
// put your main code here, to run repeatedly:
code();
}
//*************************************************
void delay_()
{
volatile long i;
for(i=0;i<400000;i++);
}
void direction()
{
volatile char *dirf,*dirk,*dirc,*dira;
dirf = 0x30; dirk = 0x107; dirc = 0x27; dira = 0x21;
*dirf =0xFF; dirk = 0xFF; *dirc = 0xFF; *dira = 0xFF;
}
void code()
{
volatile char *outf,*outk,*outc,*outa,i,j,k,l;
outf = 0x31; outk = 0x108; outc = 0x28; outa = 0x22;
for(i=0;i<=9;i++)
{
if(i == 0x00) *outf = 0xBF;
if(i == 0x01) *outf = 0x86;
if(i == 0x02) *outf = 0xDB;
if(i == 0x03) *outf = 0xCF;
if(i == 0x04) *outf = 0xE6;
if(i == 0x05) *outf = 0xED;
if(i == 0x06) *outf = 0xFD;
if(i == 0x07) *outf = 0x87;
if(i == 0x08) *outf = 0xFF;
if(i == 0x09) *outf = 0xEF;
for(j=0;j<=9;j++)
{
if(j == 0x00) *outk = 0x3F;
if(j == 0x01) *outk = 0x06;
if(j == 0x02) *outk = 0x5B;
if(j == 0x03) *outk = 0x4F;
if(j == 0x04) *outk = 0x66;
if(j == 0x05) *outk = 0x6D;
if(j == 0x06) *outk = 0x7D;
if(j == 0x07) *outk = 0x07;
if(j == 0x08) *outk = 0x7F;
if(j == 0x09) *outk = 0x6F;
for(k=0;k<=9;k++)
{
if(k == 0x00) *outc = 0x3F;
if(k == 0x01) *outc = 0x06;
if(k == 0x02) *outc = 0x5B;
if(k == 0x03) *outc = 0x4F;
if(k == 0x04) *outc = 0x66;
if(k == 0x05) *outc = 0x6D;
if(k == 0x06) *outc = 0x7D;
if(k == 0x07) *outc = 0x07;
if(k == 0x08) *outc = 0x7F;
if(k == 0x09) *outc = 0x6F;
for(l=0;l<=0;l++)
{
*outa = 0x3F;delay_();
*outa = 0x06;delay_();
*outa = 0x5B;delay_();
*outa = 0x4F;delay_();
*outa = 0x66;delay_();
*outa = 0x6D;delay_();
*outa = 0x7D;delay_();
*outa = 0x07;delay_();
*outa = 0x7F;delay_();
*outa = 0x6F;delay_();
}
}
}
}
}