Skip to content

Commit 947c96a

Browse files
committed
Added autogain hack back in
1 parent 00331b7 commit 947c96a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Adafruit_TSL2561/Adafruit_TSL2561.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def getData (self):
232232
#**************************************************************************/
233233
# Constructor
234234
#**************************************************************************/
235-
def __init__(self, addr=0x39, debug=False):
235+
def __init__(self, addr=TSL2561_ADDR_FLOAT, debug=False):
236236
self._debug = debug
237237
if (self._debug == True): print "__init__"
238238
self._addr = addr
@@ -331,8 +331,8 @@ def getLuminosity (self):
331331
# This is a hack to ensure that when looping with autogain the gain can go up and down as without
332332
# setting the gain to 1X before every reading it doesn't seem able to go from 16X
333333
# back to 1X again. Going from 1X to 16X works fine. - IC
334-
# if (self._tsl2561AutoGain):
335-
# self.setGain(self.TSL2561_GAIN_1X)
334+
if (self._tsl2561AutoGain):
335+
self.setGain(self.TSL2561_GAIN_1X)
336336

337337
if (self._debug == True): print "getLuminosity"
338338
valid = False

0 commit comments

Comments
 (0)