Skip to content

Commit 5c9d0dc

Browse files
removed silly check
Realised that the Dallas bad variables check won't work here.. so removed it.
1 parent 724a7a4 commit 5c9d0dc

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

examples/WeatherStationSensor/WeatherStationSensor.ino

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,14 @@ void loop() {
233233
// Now, let's send the measurements to the gateway.
234234

235235
// Send temperature
236-
if(temperature != -127.00 && temperature != 85.00) { // Avoids working with measurement errors.
237-
if (COMPARE_TEMP == 1 && abs(temperature - lastTemperature) < tempThreshold) { // is the temperature difference bigger than the threshold?
238-
Serial.print(temperature - lastTemperature);
239-
Serial.print("- BME280 - Temperature difference too small, so not sending the new measurement to the gateway.\n");
240-
} else {
241-
Serial.print("BME280 - Sending the new temperature to the gateway.\n");
242-
send(temperatureMsg.set(temperature, 1));
243-
lastTemperature = temperature; // Save new temperatures to be able to compare in the next round.
244-
}
245-
}
236+
if (COMPARE_TEMP == 1 && abs(temperature - lastTemperature) < tempThreshold) { // is the temperature difference bigger than the threshold?
237+
Serial.print(temperature - lastTemperature);
238+
Serial.print("- BME280 - Temperature difference too small, so not sending the new measurement to the gateway.\n");
239+
} else {
240+
Serial.print("BME280 - Sending the new temperature to the gateway.\n");
241+
send(temperatureMsg.set(temperature, 1));
242+
lastTemperature = temperature; // Save new temperatures to be able to compare in the next round.
243+
}
246244

247245
// Send humidity
248246
if (COMPARE_TEMP == 1 && abs(humidity - lastHumidity) < humThreshold) { // is the humidity difference bigger than the threshold?

0 commit comments

Comments
 (0)