void setup() {
// put your setup code here, to run once:
volatile char *dirf=0x30;
volatile char *dirk=0x107;
*dirf=0xFF;
*dirk=0x00;
/*while(1){
}*/
//*outf=number[1];
volatile char *outf=0x31,x;
volatile char *ink=0x106;
volatile char number[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x67};//without dot
volatile char number_dot[]={0xBF,0x86,0xDB,0xCF,0xE6,0xED,0xFD,0x87,0xFF,0xE7};//with dot
volatile long i,j;
while(1){
x=*ink;
if((x&0x01)==0x01){
*outf=number[8];
}
if((x&0x02)==0x02){
*outf=number[7];
}
if((x&0x04)==0x04){
*outf=number[6];
}
if((x&0x08)==0x08){
*outf=number[5];
}
if((x&0x10)==0x10){
*outf=number[4];
}
if((x&0x20)==0x20){
*outf=number[3];
}
if((x&0x40)==0x40){
*outf=number[2];
}
if((x&0x80)==0x80){
*outf=number[1];
}
}
}
void loop() {
// put your main code here, to run repeatedly:
}