Skip to content

Commit 4cd9116

Browse files
Merge pull request #17 from kolaha99/patch-2
MAX31855: fix sign of readReferenceTemperature function
2 parents 6449441 + fe1f729 commit 4cd9116

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/utility/THERMOCOUPLE/MAX31855.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,15 @@ float MAX31855Class::readReferenceTemperature(int type)
208208

209209
// The cold junction reference temperature is stored in the first 11 word's bits
210210
// sent by the Thermocouple-to-Digital Converter
211-
rawword = rawword & 0x7FF;
211+
rawword = rawword & 0xFFF;
212212
// check sign bit and convert to negative value.
213213
if (rawword & 0x800) {
214214
ref = (0xF800 | (rawword & 0x7FF))*0.0625;
215215
} else {
216216
// multiply for the LSB value
217217
ref = rawword * 0.0625f;
218218
}
219-
Serial.println(ref);
219+
220220
return ref;
221221
}
222222

0 commit comments

Comments
 (0)