fix minchange abs
This commit is contained in:
parent
0edc6dd475
commit
4de344ca57
|
@ -156,7 +156,7 @@ void loop_DHT22_temperature()
|
||||||
|
|
||||||
if (millis() >= (d.lastreadtime+d.readdelay)) {
|
if (millis() >= (d.lastreadtime+d.readdelay)) {
|
||||||
value_temperatureDHT = dht.readTemperature();
|
value_temperatureDHT = dht.readTemperature();
|
||||||
if (abs(d.lastsentvalue-value_temperatureDHT)>=d.minchange){
|
if (fabs(d.lastsentvalue-value_temperatureDHT)>=d.minchange){
|
||||||
_changed=true;
|
_changed=true;
|
||||||
}
|
}
|
||||||
d.lastreadtime=millis();
|
d.lastreadtime=millis();
|
||||||
|
@ -185,7 +185,7 @@ void loop_DHT22_humidity()
|
||||||
|
|
||||||
if (millis() >= (d.lastreadtime+d.readdelay)) {
|
if (millis() >= (d.lastreadtime+d.readdelay)) {
|
||||||
value_humidityDHT = dht.readHumidity();
|
value_humidityDHT = dht.readHumidity();
|
||||||
if (abs(d.lastsentvalue-value_humidityDHT)>=d.minchange){
|
if (fabs(d.lastsentvalue-value_humidityDHT)>=d.minchange){
|
||||||
_changed=true;
|
_changed=true;
|
||||||
}
|
}
|
||||||
d.lastreadtime=millis();
|
d.lastreadtime=millis();
|
||||||
|
@ -214,7 +214,7 @@ void loop_BH1750()
|
||||||
bool _changed=false;
|
bool _changed=false;
|
||||||
if (millis() >= (d.lastreadtime+d.readdelay)) {
|
if (millis() >= (d.lastreadtime+d.readdelay)) {
|
||||||
value_lightBH1750 = lightMeter.readLightLevel(); // [lux]
|
value_lightBH1750 = lightMeter.readLightLevel(); // [lux]
|
||||||
if (abs(d.lastsentvalue-value_lightBH1750)>=d.minchange){
|
if (fabs(d.lastsentvalue-value_lightBH1750)>=d.minchange){
|
||||||
_changed=true;
|
_changed=true;
|
||||||
}
|
}
|
||||||
d.lastreadtime=millis();
|
d.lastreadtime=millis();
|
||||||
|
|
Loading…
Reference in New Issue