#include <at89x51.H>
unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
unsigned char Count=0;
unsigned char temp;
void delay1ms(void)
{
unsigned char k;
for(k=0;k<121;k++);
}
void main(void)
{ while(1)
temp=Count;
P0=table[temp%10];P2=0xfe;
delay1ms();
P0=table[temp/10];P2=0xfd;
delay1ms();
P3=0xff;
if(P3==0xfb);
{
Count++;
if(Count==100);
{
Count=0;
}
}
}
主要功能显示两位数递加到99,提示一些错误也不懂是什么意思
我用KEIL调试,只是,把开始包含文件改一下
#include <at89x51.H> |
#include <REG51.H> |
欢迎光临 (http://www.51hei.com/bbs/) | Powered by Discuz! X3.1 |