|
#include<reg52.h>
extern uchar disp_value[5];
extern uchar key_number;
extern uchar code DC_disp3[];
uchar code AC_disp[]="AC VOL Measure ";
uchar code AC_disp2[]="value= ";
void AC_VOL_measure(void) //交流电压测量函数
{
uchar ADTemp,num;
float ValueTemp;
WriteCom(0x01); //清屏
WriteCom(0x80); //显示
for(num=0;AC_disp[num]!='\0';num++)
{
WriteData(AC_disp[num]);
Delay(10);
}
WriteCom(0x80+0x40); //显示
for(num=0;AC_disp2[num]!='\0';num++)
{
WriteData(AC_disp2[num]);
Delay(10);
}
do{
s1=0; //选择200v最高档
s2=0;
s3=1;
Delay(50);
ADTemp=ADSample(AC_VOL_adder);
if(ADTemp>253) //当超过量程时,显示为1
{ WriteCom(0x80+0x46); //显示
for(num=0;DC_disp3[num]!='\0';num++)
{
WriteData(DC_disp3[num]);
Delay(10);
}
}
else
{
ValueTemp=ValueConver(ADTemp); //测量的电压值转换
ValueTemp=ValueTemp*100; //电压值乘以档位
FloatToChar(ValueTemp); //电压值转换为字符串
WriteCom(0x80+0x46); //第二行显示电压值
for(num=0;num<6;num++)
{
WriteData(disp_value[num]);
Delay(10);
}
WriteData('V');
WriteData(' ');
}
} while((ADTemp>20)&&(key_number==2));
do
{
s1=0; //选择20v档
s2=1;
s3=0;
Delay(50);
ADTemp=ADSample(AC_VOL_adder); //起动AD进行采样
ValueTemp=ValueConver(ADTemp); //AD进行转换
ValueTemp=ValueTemp*10; //电压乘以档位
FloatToChar(ValueTemp); //电压转换为字符串
WriteCom(0x80+0x46); //第二行显示所测电压值
for(num=0;num<5;num++)
{
WriteData(disp_value[num]);
Delay(10);
}
WriteData('V');
WriteData(' ');
} while((ADTemp>24)&&(ADTemp<253)&&(key_number==2));
do
{
s1=1; //选择2V档
s2=0;
s3=0;
Delay(50);
ADTemp=ADSample(AC_VOL_adder); //起动AD进行采样
ValueTemp=ValueConver(ADTemp); //电压值转换为字符串
FloatToChar(ValueTemp);
WriteCom(0x80+0x46);
for(num=0;num<5;num++)
{
WriteData(disp_value[num]);
Delay(15);
}
WriteData('V');
WriteData(' ');
} while((ADTemp<253)&&(key_number==2));
}
001.C(2): error C129: missing ';' before 'disp_value'
怎么解决?
|
|