File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
examples/WeatherStationSensor Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -233,16 +233,14 @@ void loop() {
233
233
// Now, let's send the measurements to the gateway.
234
234
235
235
// 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
+ }
246
244
247
245
// Send humidity
248
246
if (COMPARE_TEMP == 1 && abs (humidity - lastHumidity) < humThreshold) { // is the humidity difference bigger than the threshold?
You can’t perform that action at this time.
0 commit comments