-
Notifications
You must be signed in to change notification settings - Fork 10
saturated
returns true if the sensor is saturated.
bool saturated();true if the the brightness is higher than the sensor is capable.
This depends on the settings of the sensor.
If the settings of the sensor are even at the lowest sensitivity and the sensor is still saturated you may use this or this hack to get plausible values.
If you are reading Lux values at certain settings of the sensor, you will not notice if the sensor is saturated.
At each quality and MTreg the maximum Lux you can detect is different.
A workaround is, to ask also for the raw value with the function getRaw().
If this value is 65535 than the sensor is saturated.
This library provides the constant BH1750_SATURATED so you can ask if (value==BH1750_SATURATED)....
To make it easier you only need this code:
float lux =BH1750.getLux();
if (BH1750.saturated()) //do somethingThis function returns a Boolean for the last received result.