Skip to content

Commit ee49261

Browse files
authored
Merge pull request milesburton#133 from LustigePerson/master
Fix DS18S20 off by 0.125 C
2 parents 0f76ee9 + 858509e commit ee49261

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

DallasTemperature.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ int16_t DallasTemperature::calculateTemperature(const uint8_t* deviceAddress,
528528
*/
529529

530530
if (deviceAddress[0] == DS18S20MODEL) {
531-
fpTemperature = ((fpTemperature & 0xfff0) << 3) - 16
531+
fpTemperature = ((fpTemperature & 0xfff0) << 3)
532532
+ (((scratchPad[COUNT_PER_C] - scratchPad[COUNT_REMAIN]) << 7)
533533
/ scratchPad[COUNT_PER_C]);
534534
}

0 commit comments

Comments
 (0)