Skip to content

Commit

Permalink
Fixed scaling factors (#1284)
Browse files Browse the repository at this point in the history
Should be scaled by 2^10 bot by 2^16. See datasheet https://cdn-shop.adafruit.com/datasheets/TSL2561.pdf page 24
  • Loading branch information
CzechUavGuy authored and rwaldron committed Mar 20, 2017
1 parent 9541fc2 commit 933043b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/light.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ var Controllers = {

// Page 27
// CalculateLux(...)
ch0 = (ch0 * scale) >> 0x10;
ch1 = (ch1 * scale) >> 0x10;
ch0 = (ch0 * scale) >> 10;
ch1 = (ch1 * scale) >> 10;

var ratio1 = 0;

Expand Down

0 comments on commit 933043b

Please sign in to comment.