Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of g3_waterplay by
Diff: TemperatureSensor.cpp
- Revision:
- 7:46e65aeb4df2
- Parent:
- 5:4cbe44452889
- Child:
- 10:fbab9fa07922
diff -r 931a7fe8fa52 -r 46e65aeb4df2 TemperatureSensor.cpp --- a/TemperatureSensor.cpp Fri Jun 17 12:19:16 2016 +0000 +++ b/TemperatureSensor.cpp Sun Jun 19 23:48:07 2016 +0000 @@ -38,7 +38,11 @@ double k1 = K1 * logRT; double k2 = K2 * pow(logRT, 3.0); double kelvin = 1.0 / (k0 + k1 + k2); - this->_temperature = (kelvin + KELVIN_TO_CELCIUS) + VARIANCE; + this->_temperature = (kelvin + KELVIN_TO_CELCIUS); + + if(this->_temperature > KELVIN_TO_CELCIUS){ + this->_temperature += VARIANCE; + } this->_status = 0.0; this->_strStatus = "OK";