#define uint unsigned int //宏定义// ***it wela=P2^7;
uchar code table[]={0x3f,0x06,0x5b,0x4f, 0x7f,0x6f,0x77,0x7c, 0x71 }; //数组 code数据存储器 没有就是随机存储器// void delay(uint z) //延时子程序 uint x,y; for(y=110;y>0;y--); void main() dula=1; dula=0; P0=0xc0; while(1) P3=0xfe; temp=temp&0xf0; { temp=P3; while(temp!=0xf0) temp=P3; { break; break; break; break; while(temp!=0xf0) temp=P3; } } P0=table[num-1]; } temp=P3; while(temp!=0xf0) delay(5); temp=temp&0xf0; { switch(temp) case 0xed:num=5; case 0xdd:num=6; case 0xbd:num=7; case 0x7d:num=8; } { temp=temp&0xf0; } P0=table[num-1]; } temp=P3; while(temp!=0xf0) delay(5); temp=temp&0xf0; { switch(temp) case 0xeb:num=9; case 0xdb:num=10; case 0xbb:num=11; case 0x7b:num=12; } { temp=temp&0xf0; } P0=table[num-1]; } P3=0xf7; temp=temp&0xf0; { temp=P3; while(temp!=0xf0) temp=P3; { break; break; break; break; while(temp!=0xf0) temp=P3; } dula=1; dula=0; }
|