do not use tcs values if saturated
This commit is contained in:
parent
8f0582a458
commit
f051321c81
|
@ -896,7 +896,10 @@ void loop_TCS34725_lux()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//value_tcs_lux = tcs.calculateLux(value_tcs_r, value_tcs_g, value_tcs_b);
|
//value_tcs_lux = tcs.calculateLux(value_tcs_r, value_tcs_g, value_tcs_b);
|
||||||
value_tcs_lux = tcs.lux*TCS34725_LUXFACTOR;
|
uint16_t _value_tcs_lux = tcs.lux*TCS34725_LUXFACTOR;
|
||||||
|
if (!tcs.isSaturated){ //sometimes false high reading accur around 65535 sometimes less.
|
||||||
|
value_tcs_lux = _value_tcs_lux;
|
||||||
|
}
|
||||||
|
|
||||||
if (abs((int)d.lastsentvalue-value_tcs_lux)>=d.minchange){ //int abs
|
if (abs((int)d.lastsentvalue-value_tcs_lux)>=d.minchange){ //int abs
|
||||||
_changed=true;
|
_changed=true;
|
||||||
|
@ -937,7 +940,10 @@ void loop_TCS34725_colortemp()
|
||||||
}
|
}
|
||||||
// colorTemp = tcs.calculateColorTemperature(r, g, b);
|
// colorTemp = tcs.calculateColorTemperature(r, g, b);
|
||||||
//value_colortemp = tcs.calculateColorTemperature_dn40(value_tcs_r, value_tcs_g, value_tcs_b, value_tcs_c);
|
//value_colortemp = tcs.calculateColorTemperature_dn40(value_tcs_r, value_tcs_g, value_tcs_b, value_tcs_c);
|
||||||
|
if (!tcs.isSaturated){
|
||||||
value_colortemp = tcs.ct; //with agc
|
value_colortemp = tcs.ct; //with agc
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (abs((int)d.lastsentvalue-value_colortemp)>=d.minchange){ //int abs
|
if (abs((int)d.lastsentvalue-value_colortemp)>=d.minchange){ //int abs
|
||||||
|
|
Loading…
Reference in New Issue