EA=1;
}
counter++;
TH0=0x3c;
TL0=0xaf;
}
}
/******************************************/
void init()
{
flag=1;
TMOD=0x01;
TH0=0x3c;
TL0=0xaf;
ET0=1;
EA=1;
TF0=0;
TR0=1;
EX0=1;
IT0=1;
}
/****************************************************/
void getdata(void)
{
uchar i;
addata=0;
adcs=0;
for(i=0;i<10;i++)
{
adclk=1;
adclk=0;
}
adcs=1;
delay(25);
adcs=0;
for(i=0;i<10;i++)
{
adclk=1;
addata<<=1;
if(addat)
addata++;
adclk=0;
}
delay(25);
adcs=1;
delay(25);
}
/****************************************************/
void select1(uchar k11,uchar k22,uchar k33)
{
k1=k11&0x01;
k2=k22&0x01;
k3=k33&0x01;
}
void select2(uchar k11,uchar k22,uchar k33)
{
k4=k11&0x01;
k5=k22&0x01;
k6=k33&0x01;
}
/****************************************************/
void jisuan3()
{
uchar i;
double temps;
uint t;
vv=1;
select2(0,0,1);
getdata();
temps=(double) (addata+1);
temps=temps/512;
if(addata>=1023)
{
select2(0,1,0);
getdata();
temps=(double) (addata+15);
temps=temps/512;
temps=temps*5.43;
t=temps;
vv=1;
}
if(t<1)
{
temps=temps*1000;
t=temps;
vv=2;
}
for(i=0;i<3;i++)
{
results[2-i]=t%10+'0';
t/=10;
}
results[3]='.';
t=temps;
temps=temps-(double)t;
temps=temps*1000;
t=temps;
for(i=0;i<3;i++)
{
results[6-i]=t%10+'0';
t/=10;
}
}
void jisuan4()
{
double temps;
uint t;
uchar i;
getdata();
temps=(double)addata+23;
temps=temps/512;
temps=temps/0.718;
temps-=1;
if(oo==1) temps=temps*400;
if(oo==2) temps=temps*300;
if(oo==3) temps=temps*3.09;
if(oo==4) temps=temps*23.5;
if(oo==5) temps=temps*280;
if(oo==6) temps=temps*2.88;
t=temps;
for(i=0;i<3;i++)





