非查表方式计算NTC温度
1 float GetTempera2(u16 ad) 2 { 3 float R2 = 36.5;//分压电阻36.5K 4 float B = 3950.0; 5 float R25 = 100.0;//100kOhm 6 7 float R1 = R2 * ad / (4095.0 - ad); 8 float T1 = 1.0 / (log(R1 / R25) / B + 1 / 298.15); 9 return T1 - 273.15f; 10 }
1 float GetTempera2(u16 ad) 2 { 3 float R2 = 36.5;//分压电阻36.5K 4 float B = 3950.0; 5 float R25 = 100.0;//100kOhm 6 7 float R1 = R2 * ad / (4095.0 - ad); 8 float T1 = 1.0 / (log(R1 / R25) / B + 1 / 298.15); 9 return T1 - 273.15f; 10 }