#include "header.h"
void setup() {
init();
volatile char *outf, *ink, *outa, *outc, x,y,row,num;
outf = 0x31; ink = 0x106; outa = 0x22; outc = 0x28;
unsigned char digit[] = {0x3F,0x06,0x5B,0x4f,0x66,0x6d,0x7d,0x07,0x7F,0x6F,0x00};
while(1){
for(row=0;row<4;row++){
*outf = (1<<row);
x = *ink;
if(x!=0){
delay1(30);
while(*ink !=0){}
if(row==3){
if(x == (1<<1)) num = 0;
else{
num =10;
}
}
else{
for(char col=0;col<3;col++){
if(x == (1<<col)) num = col + 1 + 3*row;
if(x == (1<<3)) num = 10;
}
}
digit1(digit[num]);
}
}
}
}
void loop() {
// put your main code here, to run repeatedly:
}