Skip to content

saturated

Starmbi edited this page Jan 27, 2020 · 15 revisions

saturated

returns true if the sensor is saturated.

bool saturated();

result Boolean

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.


Hints:

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 something

This function returns a Boolean for the last received result.

Clone this wiki locally