如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
#include<reg51.h>#defineuintunsignedintunsignedcharcodetable[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};voiddelayms(uint);sbitkey1=P3^2;sbitkey2=P3^3;voidmain(){uintshi,ge,c;while(1){shi=table[c/10];ge=table[c%10];P2=0x00;P0=shi;delayms(1);P0=0x00;P2=0x01;P0=ge;delayms(1);P0=0x00;key1=1;if(key1==0)delayms(10);{if(key1==0)c=c+1;while(!key1);}key2=1;if(key2==0)delayms(10);{if(key2==0)c=c-1;while(!key2);}}}voiddelayms(uintxms){uinti,j;for(i=xms;i>0;i--)for(j=110;j>0;j--);}