const unsigned int PT100_Sheet0_250[30]=
{ 
    10000,10390,10779,11167,11554,11940,12324,12707,13089,13470,  //0-90
    13850,14229,14606,14982,15358,15731,16104,16476,16846,17216,  //100-190
    17584,17951,18317,18612,19045,19407,19769,20129,20488,20845,  //200-290    
};
//AD_Code 根据ad值换算的阻值 
unsigned int TempSwap_PT100(unsigned int AD_Code)
{
    char  i;
    float Tempmum;
    for(i=0;i<30;i++)
    {
        if(AD_Code<=PT100_Sheet0_250[i])
        {
            Tempmum=(float)(((AD_Code-PT100_Sheet0_250[i-1])*1000)/(PT100_Sheet0_250[i]-PT100_Sheet0_250[i-1]));
            return (unsigned int)(Tempmum+(i-1)*1000);
        }
    }    
}

 

版权声明:本文为nsss原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/nsss/archive/2004/01/13/11745701.html