{
results[2-i]=t%10+'0';
t/=10;
}
results[3]='.';
t=temps;
temps=temps-t;
temps=temps*1000;
t=temps;
for(i=0;i<3;i++)
{
results[4+i]=t%10+'0';
t/=10;
}
}
void jisuan5()
{
double temps;
uchar i;
uint t;
select2(1,1,0);
if(addata)
{
getdata();
aa=1;
}
else
{
select2(0,0,1);
getdata();
aa=2;
}
temps=(long)addata;
temps=temps/512;
if(aa==1) temps=temps*2;
else temps=temps*20;
temps=temps/1.1+100;
t=temps;
for(i=0;i<3;i++)
{
results[2-i]=t%10+'0';
t/=10;
}
results[3]='.';
t=temps;
temps=temps-t;
temps=temps*1000;
t=temps;
for(i=0;i<3;i++)
{
results[4+i]=t%10+'0';
t/=10;
}
}
/****************************************************/
void main(void)
{
Mcu_init();
CLERADISPLAY
isd_pd();
select=1;
LCD12864_string(3,1,"菜單選擇");
LCD12864_string(1,2,"1.功能選擇2.確定");
while(1)
{
if(!key1) delay(20);
if(!key1)
{
while(!key1);
if(select<4)
select++;
else
select=1;
}
switch(select)
{
case 1:LCD12864_string(3,4,"電阻測(cè)量");break;
case 2:LCD12864_string(3,4,"電壓測(cè)量");break;
case 3:LCD12864_string(3,4,"電流測(cè)量");break;
case 4:LCD12864_string(3,4,"頻率測(cè)量");break;
default:break;
}
if(!key2) delay(20);
if(!key2)
{
CLERADISPLAY
LCD12864_string(1,1,"電阻:");
LCD12864_string(1,2,"電壓:");
LCD12864_string(1,3,"電流:");
LCD12864_string(1,4,"頻率:");
while(1)
{
if(!key3) delay(20);
if(!key3)
{
EA=0;





