123456789101112131415161718192021222324 |
- #include "ntc.h"
- u32 NTC_ADC_VALUE_SUM = 0;
- float Get_Temperature(u16 ADC_VALUE)
- {
- float Rp = 100000.0;
- float T2 = (273.15 + 25.0);
- float Bx = 3950.0;
- float Ka = 273.15;
- float Rt = 0.0;
- float valta = 0.0;
-
- valta = ADC_VALUE*3.3/4095;
-
- Rt = (Rp*valta)/(3.3-valta);
-
- return (1/( ( log(Rt/Rp) )/Bx+ (1/T2) )) - 272.65;
- }
|