KeilC语言编程出现交通.c(23): error C141: syntax error near 'EA'

#include <regx52.h>
#define uchar unsigned char
#define uint unsigned int
sbit ar=P1^0;
sbit ay=P1^1;
sbit ag=P1^2;
sbit br=P1^3;
sbit by=P1^4;
sbit bg=P1^5;
uchar shu[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
uchar wei[]={0xfe,0xfd,0xfb,0xf7};
uchar dispwei[4]={0,0,0,0};
uchar sec,dispweici,x=0;
uint ci;

void main(void)
{
TMOD=0x02;
TH0=0x06;
TL0=0x06;
TR0=1;
ET0=1
EA=1;
sec=31;
ar=0;ag=ay=1;
bg=0;br=by=1;
while(1);
}
void to(void) interrupt 1
{
P0=shu[dispwei[dispweici]];
P2=wei[dispweici];
dispweici++;
if(dispweici==4)
{
dispweici=0;
}
ci++;
if(ci==4000)
{ ci=0;
sec--;
if((sec>3)&&(sec<10))
{ if(x%2==0)
{ bg=!bg;
ag=ay=br=by=1;}
else if(x%2==1)
{ ag=!ag;
ar=ay=bg=by=1;}
}
else if((sec<4)&&(sec>0))
{if(x%2==0)
{ bg=br=ag=ay=1;
by=0;
}
else if(x%2==1)
{ag=ar=bg=by=1;
ay=0;
}
}
else if (sec==0)
{ sec=30;
if(x%2==0)
{ar=bg=ay=by=1;
ag=0;
by=0;
}
else if(x%2==1)
{ br=by=ag=ay=1;
bg=ar=0;
}
x++;
if(x==2)
{x=0;}
}
dispwei[1]=sec%10;
dispwei[0]=sec/10;
dispwei[2]=sec%10;
dispwei[3]=sec/10;
}

}

ET0=1 这句后面少了个分号,上分号;就可以了
温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网