I was questioning why this was put in code for the BH1750:
Code: Select all
Wire.requestFrom(BH1750_ADDRESS, 2);
byte b1 = Wire.read();
byte b2 = Wire.read();
float val=0;
val=((b1<<8)|b2)/1.2;
val=val+15;
There's 3 resolutions on this sensor:
Code: Select all
Measurement Mode Measurement Time. Resolution
H-resolution Mode2 Typ. 120ms. 0.5 lx
H-Resolution Mode Typ. 120ms. 1 lx.
L-Resolution Mode Typ. 16ms. 4 lx.
Code: Select all
H-Resolution Mode is 1 l x resolution so that it is suitable for darkness ( less than 10 lx )
H-resolution mode2 is also suitable to detect for darkness.
Could this line of code be changed, ideally, the offset should be removed.