#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar ge,shi,bai,qian;
void display (uchar ge,uchar shi);
void delay (uchar z);
uchar temp,aa;
sbit we0=P1^0;
sbit we1=P1^1;
uchar code table[]={0x28,0xEB,0x32,0xA2,0xE1,0xA4,0x24,0xEA,0x20,0xA0 }
void main()
{
TMOD=0x02;
EA=1;
ET0=1;
TR0=1;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
temp=0;
while(1)
{
if(aa==20)
{ aa=0;
temp++;
if( temp==60)
temp=0;
}
display(uchar ge,uchar shi )
}
}
void delay(uchar z)
{for( i=z;i<0;i--)
for(j=i;j<0;j--);
}
void display( uchar ge,uchar shi )
{ge=temp%10;
shi=temp/10;
we0=0;
 2=table[ge];
we0=1;
delay(5);
we1=0;
 2=table[shi];
we1=1;
delay(5);
}
compiling 秒表.c...
秒表.C(11): error C141: syntax error near 'void'
秒表.C(12): error C141: syntax error near '{'
秒表.C(13): error C231: 'TMOD': redefinition
秒表.C(13): error C231: 'TMOD': redefinition
秒表.C(14): error C231: 'EA': redefinition
秒表.C(14): error C231: 'EA': redefinition
秒表.C(15): error C231: 'ET0': redefinition
秒表.C(15): error C231: 'ET0': redefinition
秒表.C(16): error C231: 'TR0': redefinition
秒表.C(16): error C231: 'TR0': redefinition
秒表.C(17): error C231: 'TH0': redefinition
秒表.C(17): error C231: 'TH0': redefinition
秒表.C(18): error C231: 'TL0': redefinition
秒表.C(18): error C231: 'TL0': redefinition
秒表.C(19): error C231: 'temp': redefinition
秒表.C(20): error C141: syntax error near 'while'
秒表.C(20): error C141: syntax error near '1'
秒表.C(22): error C141: syntax error near '==', expected ')'
秒表.C(23): error C231: 'aa': redefinition
秒表.C(24): error C129: missing ';' before '++'
秒表.c - 20 Error(s), 0 Warning(s).
出现太多’ redefinition‘
|