We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5fb1668 + ce3190f commit d71288aCopy full SHA for d71288a
DHT.cpp
@@ -46,7 +46,7 @@ float DHT::readTemperature(bool S, bool force) {
46
f = data[2] & 0x7F;
47
f *= 256;
48
f += data[3];
49
- f /= 10;
+ f *= 0.1;
50
if (data[2] & 0x80) {
51
f *= -1;
52
}
@@ -60,11 +60,11 @@ float DHT::readTemperature(bool S, bool force) {
60
61
62
float DHT::convertCtoF(float c) {
63
- return c * 9 / 5 + 32;
+ return c * 1.8 + 32;
64
65
66
float DHT::convertFtoC(float f) {
67
- return (f - 32) * 5 / 9;
+ return (f - 32) * 0.55555;
68
69
70
float DHT::readHumidity(bool force) {
@@ -79,7 +79,7 @@ float DHT::readHumidity(bool force) {
79
f = data[0];
80
81
f += data[1];
82
83
break;
84
85
0 commit comments