claws / BH1750

An Arduino library for the digital light sensor breakout boards containing the BH1750FVI IC
MIT License
248 stars 107 forks source link

Possible arithmetic error evident with larger MTreg #86

Open arc12 opened 1 year ago

arc12 commented 1 year ago

I ran three readings with varying MTreg values (31, default, 200). Across a range of light levels (in the 100-500 lux range), the lux value computed for MTreg=200 was wildly different to the other cases.

This makes me suspect that there is a bug, probably involving incorrect data types and/or integer division. This could be in the calculation of the time interval (this is tentatively confirmed by injecting my own time delay).

[version 1.3.0 used on ESP8266 arduino platform]