MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / getTemperature

Method getTemperature

libraries/MAX31855_RT/MAX31855.cpp:200–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198
199
200float 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 --

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36