//02 Display 0.0 to 9.9 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<500000;i++);
}
void direction()
{
volatile char *dirf,*dirk;
dirf =0x30; dirk = 0x107;
*dirf =0xFF; *dirk = 0xFF;
}
void code()
{
volatile char *outf,*outk,i,j;
outf = 0x31; outk = 0x108;
for(i=0;i<=9;i++)
{
if(i == 0) *outf = 0xBF;
if(i == 1) *outf = 0x86;
if(i == 2) *outf = 0xDB;
if(i == 3) *outf = 0xCF;
if(i == 4) *outf = 0xE6;
if(i == 5) *outf = 0xED;
if(i == 6) *outf = 0xFD;
if(i == 7) *outf = 0x87;
if(i == 8) *outf = 0xFF;
if(i == 9) *outf = 0xEF;
for(j=0;j<=0;j++)
{
*outk = 0x3F;delay_();
*outk = 0x06;delay_();
*outk = 0x5B;delay_();
*outk = 0x4F;delay_();
*outk = 0x66;delay_();
*outk = 0x6D;delay_();
*outk = 0x7D;delay_();
*outk = 0x07;delay_();
*outk = 0x7F;delay_();
*outk = 0x6F;delay_();
}
}
}