Skip to content

Commit d996e18

Browse files
committed
Update HumiditySensor.ino
Just corrected formating a little bit...
1 parent 714d630 commit d996e18

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

libraries/MySensors/examples/HumiditySensor/HumiditySensor.ino

+8-6
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ boolean metric = true;
5050
MyMessage msgHum(CHILD_ID_HUM, V_HUM);
5151
MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
5252

53-
5453
void setup()
5554
{
5655
dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN);
@@ -68,11 +67,11 @@ void presentation()
6867
present(CHILD_ID_TEMP, S_TEMP);
6968
}
7069

71-
7270
void loop()
7371
{
7472
delay(dht.getMinimumSamplingPeriod());
75-
73+
74+
// Fetch temperatures from DHT sensor
7675
float temperature = dht.getTemperature();
7776
if (isnan(temperature)) {
7877
Serial.println("Failed reading temperature from DHT");
@@ -82,21 +81,24 @@ void loop()
8281
temperature = dht.toFahrenheit(temperature);
8382
}
8483
send(msgTemp.set(temperature, 1));
84+
#if MY_DEBUG
8585
Serial.print("T: ");
8686
Serial.println(temperature);
87+
#endif
8788
}
8889

90+
// Fetch humidity from DHT sensor
8991
float humidity = dht.getHumidity();
9092
if (isnan(humidity)) {
9193
Serial.println("Failed reading humidity from DHT");
9294
} else if (humidity != lastHum) {
9395
lastHum = humidity;
9496
send(msgHum.set(humidity, 1));
97+
#if MY_DEBUG
9598
Serial.print("H: ");
9699
Serial.println(humidity);
100+
#endif
97101
}
98-
102+
99103
sleep(SLEEP_TIME); //sleep a bit
100104
}
101-
102-

0 commit comments

Comments
 (0)