fix resistor calculation

This commit is contained in:
Wolfgang Hottgenroth 2019-02-12 20:40:22 +01:00
parent 50ad7576f5
commit c24884a5c7
Signed by: wn
GPG Key ID: B586EAFCDF2F65F4

View File

@ -55,9 +55,9 @@ void measureCollectAndProcessConversion() {
} else if (nAvg == N_MAX) {
r = FLT_MAX;
} else {
r = R_REF / ((((float)N_MAX) / ((float)nAvg)) - 1.0);
r = ((((float)N_MAX) / ((float)nAvg)) - 1.0) * R_REF;
}
float t = (r / PT1000_R0 - 1) / PT1000_Coeff;
float t = ((r / PT1000_R0) - 1) / PT1000_Coeff;
uint8_t temperature = (t < 0) ? 0 : ((uint8_t)t);