标题: 帮看看这程序哪里出问题,总提示警告错误,不能调试 [打印本页]

作者: river    时间: 2009-8-27 22:53
标题: 帮看看这程序哪里出问题,总提示警告错误,不能调试

#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,提示一些错误也不懂是什么意思
 


作者: guoliliab    时间: 2009-8-28 08:59

我用KEIL调试,只是,把开始包含文件改一下

#include <at89x51.H>

改为

#include <REG51.H>

再编译就通过了


作者: river    时间: 2009-8-28 19:45
不行哦,老兄,我试了一样的错误,调试时程序就不运行




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1