,'0','0','0'};cData[0]=uValue%100000/10000+'0';cData[1]=uValue%10000/1000+'0';cData[2]=uValue%1000/100+'0';cData[3]=uValue%100/10+'0';cData[4]=uValue%10/1+'0';if(0!=uValue){for(i=0;i<5;i++){if('0'!=cData[i])break;if('0'==cData[i])cData[i]='';}}elseif(0==uValue){for(i=0;i<4;i++){cData[i]='';}}UART0_Send("",1);UART0_Send(cData,5);UART0_Send("",1);}voidUART0_Dis_fNum(floatfValue){uint16uValue=(uint16)(100*fValue);charcData[5]={'0','0','.','0','0'};cData[0]=uValue%10000/1000+'0';cData[1]=uValue%1000/100+'0';cData[2]='.';cData[3]=uValue%100/10+'0';cData[4]=uValue%10/1+'0';UART0_Send("",1);UART0_Send(cData,5);UART0_Send("",1);}#pragmavector=URX0_VECTOR__interruptvoidUART0_ISR(void){//hartemp[1];//temp[0]=U0DBUF;//UART0_Send(temp,1);URX0IF=0; //清中断标志}【实验结果及现象】当运行该程序并用火焰燃烧传感器端口时可以在串口执行软件窗口中看到如下结果: