Skip to content

Commit bba998b

Browse files
committed
Fix farenheit conversion
When temperature in C was below 0, the conversion to F was wrong due to treating the C value as unsigned integer instead of signed integer. See http://bit.ly/3ckRfxp for more information. Thanks to hoggin for reporting this problem.
1 parent f4411cd commit bba998b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/SI7021/SI7021.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ bool SI7021::sensorExists() {
3838
}
3939

4040
int SI7021::getFahrenheitHundredths() {
41-
unsigned int c = getCelsiusHundredths();
41+
int c = getCelsiusHundredths();
4242
return (1.8 * c) + 3200;
4343
}
4444

0 commit comments

Comments
 (0)