求帮忙,试试.C(31): error C141: syntax error near 'unsigned'怎么改?
时间:10-02
整理:3721RD
点击:
试试.C(31): error C141: syntax error near 'unsigned'怎么改?
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit KEY1=P0^0;
sbit KEY2=P0^1;
sbit KEY3=P0^2;
sbit KEY4=P0^3;
sbit F4=P3^5;
sbit led1=P3^4;
uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
void delayms(uint);
void key_scan_pro();
void display(uchar,uchar,uchar);
uchar num,num1,num2,min,fj,shi,ge;
void main()
{
TMOD=0X11;
TH0=0x3c;
TL0=0xaf;
TH1=0x3c;
TL1=0xaf;
EA=1;
ET0=1;
ET1=1;
TR0=1;
TR1=1;
F4=0;
min=5,shi=0,ge=0;
while(1)
{
display(uchar min,shi,ge);
key_scan_pro();
}
}
void diaplay(uchar min,uchar shi,uchar ge)
{
P1=table{min};
P1=0xff;
P2=0xef;
delayms(5);
P1=0x40;
P1=0xff;
P2=0xf7;
delayms(5);
P1=table{shi};
P1=0xff;
P2=0xfb;
delayms(5);
P1=table{ge};
p1=0xff;
p2=0xfd;
delayms(5);
}
void delayms(uint xms)
{
uint i,j;
for(i=xms;i>0;i--)
for(j=110;j>0;j--);
}
void T0_time()interrupt 1
{
TH0=0x3c;
TL0=0xaf;
num1++;
if(num==4)
{
num1=0;
led1=~led1;
}
}
void T1_time()interrupt 3
{
TH0=0x3c;
TL0=0xaf;
num++;
if(num==20)
{
num=0;
num2++;
if(num2==60)
min--;
num2=0;
shi=(60-num2)/10;
ge=(60-num2)%10 ;
if((0==min)&&(shi==0)&&(ge==0))
TR0=0;TR1=0;F4=1;led1=1;
}
}
void key_scan_pro()
{
if(KEY4==0)
{
delayms(10);
if(KEY4==0)
{ TRO=0;TR1=0; }
while(KEY4==0);
delayms(10);
If(KEY1==0)
delayms(10);
If(KEY1==0)
min++;
while(KEY1==0);
delayms(10);
If(KEY2==0)
delayms(10);
If(KEY2==0)
shi++;
while(KEY2==0);
delayms(10);
If(KEY3==0)
delayms(10);
If(KEY3==0)
ge++;
while(KEY3==0);
delayms(10);
}
}
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit KEY1=P0^0;
sbit KEY2=P0^1;
sbit KEY3=P0^2;
sbit KEY4=P0^3;
sbit F4=P3^5;
sbit led1=P3^4;
uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
void delayms(uint);
void key_scan_pro();
void display(uchar,uchar,uchar);
uchar num,num1,num2,min,fj,shi,ge;
void main()
{
TMOD=0X11;
TH0=0x3c;
TL0=0xaf;
TH1=0x3c;
TL1=0xaf;
EA=1;
ET0=1;
ET1=1;
TR0=1;
TR1=1;
F4=0;
min=5,shi=0,ge=0;
while(1)
{
display(uchar min,shi,ge);
key_scan_pro();
}
}
void diaplay(uchar min,uchar shi,uchar ge)
{
P1=table{min};
P1=0xff;
P2=0xef;
delayms(5);
P1=0x40;
P1=0xff;
P2=0xf7;
delayms(5);
P1=table{shi};
P1=0xff;
P2=0xfb;
delayms(5);
P1=table{ge};
p1=0xff;
p2=0xfd;
delayms(5);
}
void delayms(uint xms)
{
uint i,j;
for(i=xms;i>0;i--)
for(j=110;j>0;j--);
}
void T0_time()interrupt 1
{
TH0=0x3c;
TL0=0xaf;
num1++;
if(num==4)
{
num1=0;
led1=~led1;
}
}
void T1_time()interrupt 3
{
TH0=0x3c;
TL0=0xaf;
num++;
if(num==20)
{
num=0;
num2++;
if(num2==60)
min--;
num2=0;
shi=(60-num2)/10;
ge=(60-num2)%10 ;
if((0==min)&&(shi==0)&&(ge==0))
TR0=0;TR1=0;F4=1;led1=1;
}
}
void key_scan_pro()
{
if(KEY4==0)
{
delayms(10);
if(KEY4==0)
{ TRO=0;TR1=0; }
while(KEY4==0);
delayms(10);
If(KEY1==0)
delayms(10);
If(KEY1==0)
min++;
while(KEY1==0);
delayms(10);
If(KEY2==0)
delayms(10);
If(KEY2==0)
shi++;
while(KEY2==0);
delayms(10);
If(KEY3==0)
delayms(10);
If(KEY3==0)
ge++;
while(KEY3==0);
delayms(10);
}
}
你求帮忙做什么啊?这求助有点意思啊!
看不懂
你前面两条预编译指令是不是关键字之间有别的字符