做万用表时测的电压值,在上位机上显示不出来
时间:10-02
整理:3721RD
点击:
void COM_Sfun3(float ch)
{
TR1=1;
TI = 1;
//ch=table2[1];
//SBUF=ch;
printf(" 当前数据:%.2f V \n ",ch);//往串口输出数据
TI = 0;
TR1=0;
}
/*主函数*/
void main()
{
//声明变量
unsigned long int temp;
int i;
while(sw1);
{
while(1)
{
temp=0;i=10;
while(i--)
{
temp+=ADC_0808();
}
display(temp/10);
COM_Sfun3((float)temp/1000);
delay(10);//延时
display(temp/10);//显示调用
}
}
}