Thermistor
Dependents: Nucleo_UDS_controller_Alberto_version
Diff: Thermistor.cpp
- Revision:
- 0:d4198719a504
diff -r 000000000000 -r d4198719a504 Thermistor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Thermistor.cpp Sun Sep 07 16:19:42 2014 +0000 @@ -0,0 +1,14 @@ +#include "Thermistor.h" + +Thermistor::Thermistor(float T0,float R0,float B){ + T0_ = T0; + K0_ = T0_+273.0; + R0_ = R0; + B_ = B; +} + +float Thermistor::trans_R2T(float R){ + float K = (B_*K0_)/(K0_*log(R/R0_)+B_); + float temp = K-273.0; + return temp; +} \ No newline at end of file