Skip to content

Commit 3112208

Browse files
authored
Merge pull request #352 from Delanet/patch-1
Error correction in setMT(mt) function.
2 parents 0fa3e80 + fa69709 commit 3112208

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

devices/BH1750.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ BH1750.prototype.start= function(resolution,onetime) { //resolution: 1 = 1 lx (r
8181
};
8282

8383
BH1750.prototype.setMT=function(mt) {
84-
this.factor=1.2/(69/X);
8584
mt=E.clip(mt,31,254);
85+
this.factor=1.2/(69/mt);
8686
this.i2c.writeTo(this.i2ca,0x80+((mt&0xE0)>>3));
8787
this.i2c.writeTo(this.i2ca,0xB0+(mt&0x1F));
8888
}

0 commit comments

Comments
 (0)