-
Notifications
You must be signed in to change notification settings - Fork 10
getMTregTime
Starmbi edited this page Jan 12, 2020
·
4 revisions
returns the estimated conversion time.
unsigned int getMtregTime();
unsigned int getMtregTime(byte mtreg);
unsigned int getMtregTime(byte mtreg, Quality quality);
The estimated time in millisecond for the sampling time at a given Quality and MTreg.
a value between BH1750_MTREG_LOW
(default = 31) and BH1750_MTREG_HIGH
(default 254).
see writeMtreg() or working principles for more details.
enum BH1750Quality
{
BH1750_QUALITY_HIGH = 0x20,
BH1750_QUALITY_HIGH2 = 0x21,
BH1750_QUALITY_LOW = 0x23,
};
see setQuality for more details.
to calculate the estimated conversion time, the Quality and MTreg is needed.
A call to the function with with missing parameters will use the current values.
If you call the function without calibrate the sensor before, you will get up to 50% longer times than the sensor needs.
An example how to obtain the lowest and highest conversion time at a given Quality:
unsigned int low = getMtregTime(BH1750_MTREG_LOW , BH1750_QUALITY_HIGH);
unsigned int high = getMtregTime(BH1750_MTREG_HIGH , BH1750_QUALITY_HIGH);