非查表方式计算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 }

 

 

posted @ 2023-12-04 17:29  =天赋=  阅读(41)  评论(0编辑  收藏  举报