| 198 | |
| 199 | |
| 200 | float MAX31855::getTemperature() |
| 201 | { |
| 202 | // offset needs to be added after multiplication TCfactor |
| 203 | // not before otherwise offset will be larger / smaller |
| 204 | // default behaviour |
| 205 | if (_SeebeckC == K_TC) return _temperature + _offset; |
| 206 | |
| 207 | // EXPERIMENTAL OTHER THERMOCOUPLES |
| 208 | // to be tested |
| 209 | // in practice this works also for K_TC but is way slower.. |
| 210 | // 1: reverse calculate the Voltage measured (is this correct?) |
| 211 | float Vout = K_TC * (_temperature - _internal); // PAGE 8 datasheet |
| 212 | |
| 213 | // 2: from Voltage to corrected temperature using the Seebeck Coefficient |
| 214 | float _temp = Vout / _SeebeckC + _internal + _offset; |
| 215 | return _temp; |
| 216 | } |
| 217 | |
| 218 | |
| 219 | // -- END OF FILE -- |