Skip to content

Commit d71288a

Browse files
committed
Merge branch 'jmdana-master'
2 parents 5fb1668 + ce3190f commit d71288a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

DHT.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ float DHT::readTemperature(bool S, bool force) {
4646
f = data[2] & 0x7F;
4747
f *= 256;
4848
f += data[3];
49-
f /= 10;
49+
f *= 0.1;
5050
if (data[2] & 0x80) {
5151
f *= -1;
5252
}
@@ -60,11 +60,11 @@ float DHT::readTemperature(bool S, bool force) {
6060
}
6161

6262
float DHT::convertCtoF(float c) {
63-
return c * 9 / 5 + 32;
63+
return c * 1.8 + 32;
6464
}
6565

6666
float DHT::convertFtoC(float f) {
67-
return (f - 32) * 5 / 9;
67+
return (f - 32) * 0.55555;
6868
}
6969

7070
float DHT::readHumidity(bool force) {
@@ -79,7 +79,7 @@ float DHT::readHumidity(bool force) {
7979
f = data[0];
8080
f *= 256;
8181
f += data[1];
82-
f /= 10;
82+
f *= 0.1;
8383
break;
8484
}
8585
}

0 commit comments

Comments
 (0)