}
shu=0;
bai=shu/100; shi=shu0/10; ge=shu;
void display(uchar aa,uchar bb,uchar cc) {
dula=1;
dula=1;
dula=1;
P0=table[cc];
P0=table[bb]; dula=0; P0=0xff; wela=1; P0=0xfd; wela=0; delay(1);
P0=table[aa]; dula=0; P0=0xff; wela=1; P0=0xfe; wela=0; delay(1);
}
dula=0; P0=0xff; wela=1; P0=0xfb; wela=0; delay(1);
#include
uint keyscan();
void display(uchar,uchar,uchar); void main() {
uint x,y; for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
dula=1; P0=0; dula=0; wela=1; P0=0xc0; wela=0; while(1) { }
num1=keyscan();
display(num1/100,num10/10,num1);
void display(uchar aa,uchar bb,uchar cc) {
dula=1;
dula=1;
P0=table[bb]; dula=0; P0=0xff; wela=1; P0=0xfd; wela=0;
P0=table[aa]; dula=0; P0=0xff; wela=1; P0=0xfe; wela=0; delay(1);
delay(1);
dula=1; }
uint keyscan() {
P3=0xfe; temp=P3; temp=temp&0xf0; while(temp!=0xf0) {
delay(5); temp=P3; temp=temp&0xf0; while(temp!=0xf0) {
temp=P3;
P0=table[cc]; dula=0; P0=0xff; wela=1; P0=0xfb; wela=0; delay(1);
switch(temp) {
case 0xee:num=1;
break;
case 0xde:num=4;
break;
}
}
case 0xbe:num=9;
break;
case 0x7e:num=16;
break;
while(temp!=0xf0) { } }
temp=P3; temp=temp&0xf0;
P3=0xfd; temp=P3; temp=temp&0xf0; while(temp!=0xf0) {
delay(5); temp=P3; temp=temp&0xf0; while(temp!=0xf0) {
temp=P3;
switch(temp) {
case 0xed:num=25;
break;
case 0xdd:num=36;
break;