keil 编程中 error c141:syntax error near ‘;’ 到底是哪里错啦??
#include<reg51.h>#definesegP2#definescanpP3#defineucharunsignedchar#defineuintunsigne...
#include<reg51.h>
#define seg P2
#define scanp P3
#define uchar unsigned char
#define uint unsigned int
sbit key=P1^0;
uchar tab[11]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xbf};
uchar disp[4];
#define count 50000;
#define h_0 (65536-count)/256
#define l_0 (65536-count)%256
uchar time=0;
bit status_F=1;
uchar scan=1;
uint freq=0;
sfr16 DPTR = 0x82;
void delay(uint);
void startmeasure(void);
void display(uint);
main()
{
while(1)
{
if(key==0)
{
delay(20);
if(key==0)
{
status_F=0;
startmeasure();
while(status_F==0);
}
}
display(freq);
}
}
void startmeasure()
{
scanp=0Xff;
IE=0X82;
TMOD=0X51;
TH0 = h_0;TL0 = l_0;
TH1 = 0; TL1 = 0;
TR0 = 1; TR1 = 1;
}
void T0_int() interrupt 1
{
TH0=h_0;TL0=l_0;
if(++time=20)
{
time=0;
status_F=1;
TR1=0;
TR0=0;
DPL=TL1;
DPH=TH1;
freq=DPTR;
}
}
void display(uint dat)
{
uchar i;
if(dat>=1000)
{
disp[0]=tab[10];
disp[1]=tab[10];
disp[2]=tab[dat/10000];
disp[3]=tab[(dat/1000)%10]
}
else
{
disp[0]=tab[dat/1000];
disp[1]=tab[(dat/100)%10];
disp[2]=tab[(dat/10)%10];
disp[3]=tab[dat%10];
}
scan=0x01;
for(i=0;i<4;i++)
{
seg=0xff;
scanp=~scan;
seg=disp[i];
delay[4];
scan<<=1;
}
}
void delay(uint k)
{
uint i,j;
for(i=0;i<k;i++)
for(j=0;j<120;j++)
}
错误的地方在图片这
这个哪里有语法错误呀?? 展开
#define seg P2
#define scanp P3
#define uchar unsigned char
#define uint unsigned int
sbit key=P1^0;
uchar tab[11]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xbf};
uchar disp[4];
#define count 50000;
#define h_0 (65536-count)/256
#define l_0 (65536-count)%256
uchar time=0;
bit status_F=1;
uchar scan=1;
uint freq=0;
sfr16 DPTR = 0x82;
void delay(uint);
void startmeasure(void);
void display(uint);
main()
{
while(1)
{
if(key==0)
{
delay(20);
if(key==0)
{
status_F=0;
startmeasure();
while(status_F==0);
}
}
display(freq);
}
}
void startmeasure()
{
scanp=0Xff;
IE=0X82;
TMOD=0X51;
TH0 = h_0;TL0 = l_0;
TH1 = 0; TL1 = 0;
TR0 = 1; TR1 = 1;
}
void T0_int() interrupt 1
{
TH0=h_0;TL0=l_0;
if(++time=20)
{
time=0;
status_F=1;
TR1=0;
TR0=0;
DPL=TL1;
DPH=TH1;
freq=DPTR;
}
}
void display(uint dat)
{
uchar i;
if(dat>=1000)
{
disp[0]=tab[10];
disp[1]=tab[10];
disp[2]=tab[dat/10000];
disp[3]=tab[(dat/1000)%10]
}
else
{
disp[0]=tab[dat/1000];
disp[1]=tab[(dat/100)%10];
disp[2]=tab[(dat/10)%10];
disp[3]=tab[dat%10];
}
scan=0x01;
for(i=0;i<4;i++)
{
seg=0xff;
scanp=~scan;
seg=disp[i];
delay[4];
scan<<=1;
}
}
void delay(uint k)
{
uint i,j;
for(i=0;i<k;i++)
for(j=0;j<120;j++)
}
错误的地方在图片这
这个哪里有语法错误呀?? 展开
2012-11-20 · 知道合伙人软件行家
关注
展开全部
#include<reg51.h>
#define seg P2
#define scanp P3
#define uchar unsigned char
#define uint unsigned int
sbit key=P1^0;
uchar tab[11]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xbf};
uchar disp[4];
#define count 50000 //、、、、、无分号
#define h_0 (65536-count)/256
#define l_0 (65536-count)%256
uchar time=0;
bit status_F=1;
uchar scan=1;
uint freq=0;
sfr16 DPTR = 0x82;
void delay(uint);
void startmeasure(void);
void display(uint);
main()
{
while(1)
{
if(key==0)
{
delay(20);
if(key==0)
{
status_F=0;
startmeasure();
while(status_F==0);
}
}
display(freq);
}
}
void startmeasure()
{
scanp=0Xff;
IE=0X82;
TMOD=0X51;
TH0 = h_0;
TL0 = l_0;
TH1 = 0;
TL1 = 0;
TR0 = 1;
TR1 = 1;
}
void T0_int() interrupt 1
{
TH0=h_0;TL0=l_0;
if(++time==20)//、、、、、==
{
time=0;
status_F=1;
TR1=0;
TR0=0;
DPL=TL1;
DPH=TH1;
freq=DPTR;
}
}
void display(uint dat)
{
uchar i;
if(dat>=1000)
{
disp[0]=tab[10];
disp[1]=tab[10];
disp[2]=tab[dat/10000];
disp[3]=tab[(dat/1000)%10];//、、、、、、、分号
}
else
{
disp[0]=tab[dat/1000];
disp[1]=tab[(dat/100)%10];
disp[2]=tab[(dat/10)%10];
disp[3]=tab[dat%10];
}
scan=0x01;
for(i=0;i<4;i++)
{
seg=0xff;
scanp=~scan;
seg=disp[i];
delay(4);//、、、、、()
scan<<=1;
}
}
void delay(uint k)
{
uint i,j;
for(i=0;i<k;i++)
for(j=0;j<120;j++) ;//、、、、、、、分号
}
#define seg P2
#define scanp P3
#define uchar unsigned char
#define uint unsigned int
sbit key=P1^0;
uchar tab[11]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xbf};
uchar disp[4];
#define count 50000 //、、、、、无分号
#define h_0 (65536-count)/256
#define l_0 (65536-count)%256
uchar time=0;
bit status_F=1;
uchar scan=1;
uint freq=0;
sfr16 DPTR = 0x82;
void delay(uint);
void startmeasure(void);
void display(uint);
main()
{
while(1)
{
if(key==0)
{
delay(20);
if(key==0)
{
status_F=0;
startmeasure();
while(status_F==0);
}
}
display(freq);
}
}
void startmeasure()
{
scanp=0Xff;
IE=0X82;
TMOD=0X51;
TH0 = h_0;
TL0 = l_0;
TH1 = 0;
TL1 = 0;
TR0 = 1;
TR1 = 1;
}
void T0_int() interrupt 1
{
TH0=h_0;TL0=l_0;
if(++time==20)//、、、、、==
{
time=0;
status_F=1;
TR1=0;
TR0=0;
DPL=TL1;
DPH=TH1;
freq=DPTR;
}
}
void display(uint dat)
{
uchar i;
if(dat>=1000)
{
disp[0]=tab[10];
disp[1]=tab[10];
disp[2]=tab[dat/10000];
disp[3]=tab[(dat/1000)%10];//、、、、、、、分号
}
else
{
disp[0]=tab[dat/1000];
disp[1]=tab[(dat/100)%10];
disp[2]=tab[(dat/10)%10];
disp[3]=tab[dat%10];
}
scan=0x01;
for(i=0;i<4;i++)
{
seg=0xff;
scanp=~scan;
seg=disp[i];
delay(4);//、、、、、()
scan<<=1;
}
}
void delay(uint k)
{
uint i,j;
for(i=0;i<k;i++)
for(j=0;j<120;j++) ;//、、、、、、、分号
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询