void setup() {
// put your setup code here, to run once:
volatile char *dirf=0x30,*dirk=0x107,*dirc=0x27,*dira=0x21;
*dirf=0xff;
*dirk=0xff;
*dirc=0xff;
*dira=0xff;
}
void loop() {
// put your main code here, to run repeatedly:
volatile short n;
for(n=0;n<10000;n++)
{
display(n);
}
}
void display(short n) {
// put your main code here, to run repeatedly:
volatile char num[10]={0x3f,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0X6F};
volatile char alph[26]={0x77,0x7c,0x39,0x5e,0x79,0x71,0x7d,0x76,0x06,0x1e,0x38,0x54,0x5c,0x73,0x67,0x50,0x6d,0x78,0x3e,0x6e,0x5b};
//volatile char s[9]={0,1,2,4,8,16,32,64,128};
volatile char i,j,k,dp=0x80,t=0,s;
volatile short n;;
volatile long l;
volatile char *out[4]={
(volatile char *)0x22, // 1's display 0
(volatile char *)0x28, // 10's display 1
(volatile char *)0x108, // 100's display 2
(volatile char *)0x31}; // 1000's display 3
volatile char digit[4];
for(i=0;i<4;i++)
{
s=n%10;
digit[i]=num[s];
n/=10;
}
for(i=0;i<4;i++){
*out[i]=digit[i];
//for(l=1;l<600000;l++);
}
}