Skip to content

Commit c497cf7

Browse files
committed
Merge pull request arduino#126 from tbowmo/master
Corrected a celcius/fahrenheit conversion,
2 parents 3836d8a + f47ef2c commit c497cf7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/MySensors/examples/SensebenderMicro/SensebenderMicro.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,13 @@ void sendTempHumidityMeasurements(bool force)
201201

202202
raHum.addValue(data.humidityPercent);
203203

204-
float diffTemp = abs(lastTemperature - data.celsiusHundredths/100);
204+
float diffTemp = abs(lastTemperature - (isMetric ? data.celsiusHundredths : data.fahrenheitHundredths)/100);
205205
float diffHum = abs(oldAvgHum - raHum.getAverage());
206206

207207
Serial.print(F("TempDiff :"));Serial.println(diffTemp);
208208
Serial.print(F("HumDiff :"));Serial.println(diffHum);
209209

210-
if (isnan(diffTemp)) tx = true;
210+
if (isnan(diffHum)) tx = true;
211211
if (diffTemp > TEMP_TRANSMIT_THRESHOLD) tx = true;
212212
if (diffHum >= HUMI_TRANSMIT_THRESHOLD) tx = true;
213213

0 commit comments

Comments
 (0)