帮忙改下错误
有谁懂的帮我看下, 编译后有好多错误,但是我不知道怎么改了,帮忙看下谢谢了#include "reg52.h"
#include "intrins.h"
#define uchar unsigned char
#define uint unsigned int
uchar code
duan_ma[]={0x81,0xcf,0x92,0x86,0xcc,0xa4,0xa0,0x8f,0x80,0x84};//共阳
uchar code wei_ma[]={0xfe,0xfd,0xfb,0xf7,0xef};
uchar data dx[3]={0x5,0x6,0x7};
uint count=2,jishu,flag;
uint Data=0,temp;uchar t=0;
uchar m1=0;
uchar tmp1;
uint temp,data_d=0;
sbit CLK=P3^3;
sbit OE=P3^2;
sbit EOC=P3^1;
sbit ST=P3^0;
sbit en1=P3^6;
sbit s1=P3^4;
sbit S2=P3^5;
sbit ADD_Key=P2^5;
sbit SET_KEY=P2^6;
void motor(uchar index,char speed)
{
if(speed<=100)
{
if(index==1)
{
m1=speed;
s1=1;
s2=0;
}
}
}
void delay(uint j)
{
for(j;j>0;j--);
}
tik();
{
uint i;
dx[0]=data_d%10;
dx[1]=data_d/10%10;
dx[2]=data_d/100;
for(i=0;i<3;i++)
{
P2=wei_ma[i];
P0=duan_ma[dx[i]];
delay(120);
P2=0xff;
}
motor(1,data_d);
delay(5000);
}
dishu()
{
if(ADD_Key==0)
{
delay(120);
while(ADD_Key==0);
data_d=data_d-10;
}
tik();
}
tek()
{
uint i;
dx[0]=data_d%10;
dx[1]=data_d/10%10;
dx[2]=data_d/100;
for(i=0;i<3;i++)
{
P2=wei_ma[i];
P0=duan_ma[dx[i]];
delay(120);
P2=0xff;
}
motor(1,data_d);
delay(5000);
}
gaoshu()
{
if(ADD_Key==0)
{
delay(120);
while(ADD_Key==0);
data_d=data_d+10;
}
tek();
}
shezhi()
{
if(SET_KEY==0)
{
flag=1;
while(SET_KEY==0);
flag=1;
count++;
jishu=count%3;
}
}
disp()
{
uchar i,j;
temp=(uint)(Data*2.4/(0.013*255))-76;
data_d=temp;
motor(1,data_d);
dx[0]=temp%10;
dx[1]=temp/10%10;
dx[2]=temp/100;
for(j=0;j<200;j++)
{
for(i=0;i<3;i++)
{
P2=wei_ma[i];
P0=duan_ma[dx[i]];
delay(120);
}
}
hucai()
{
TR0=1;
ST=1;
_nop_();
_nop_();
ST=0;
_nop_();
_nop_();
while(EOC=0);
OE=1;
Data=P1;
OE=0;
TR0=0;
}
maichong()
{
TMOD=0x22;
THO=0xff;
TL0=0xff;
TH1=0x00;
TL1=0x00;
EA=1;
ET0=1;
ET1=1;
TR1=1;
}
main()
{
maichong()
while(1)
{
shezhi();
if(flag==1)
{
switch(jishu)
{
case 0:
//tek();
gaoshu();
break;
case 1:
//tik();
dishu();
break;
case 2:
shucai();
disp();
break;
}}
}
else
{
shucai();
disp();
}
}
}
void timeT0() interrupt 1
{CLK=~CLK; }
void timeT1() interrupt 3
{
if(t==0)
{temp1=m1;}
if(t<temp1) en1=1;
else
en1=0;
t++;
if(t>=100) t=0;
}