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

Method read

libraries/MAX31850/MAX31850.cpp:95–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93
94
95float MAX31850::read(void)
96{
97 ScratchPad scratchPad;
98 for (int i = 0; i < 9; i++) scratchPad[i] = 0;
99
100 // NO CRC CHECK
101 readScratchPad(scratchPad, 5);
102
103 _failFlag = scratchPad[TC_TEMP_LSB] & 0x01;
104 int16_t rawTemperature = (((int16_t)scratchPad[TC_TEMP_MSB]) << 6) | scratchPad[TC_TEMP_LSB] >> 2;
105 _TCTemp = 0.25 * rawTemperature;
106
107 _errorBits = scratchPad[INTERN_TEMP_LSB] & 0x07;
108 rawTemperature = (((int16_t)scratchPad[INTERN_TEMP_LSB]) << 4) | scratchPad[INTERN_TEMP_LSB] >> 4;
109 _internalTemp = 0.0625 * rawTemperature;
110
111 _addrBits = scratchPad[CONFIGURATION] & 0x0F;
112
113 return _TCTemp;
114}
115
116
117float MAX31850::getTempTC(void)

Callers 1

readScratchPadMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected