We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b61fc0b commit 0d5d8b6Copy full SHA for 0d5d8b6
adafruit_tsl2561.py
@@ -135,9 +135,9 @@ def integration_time(self, time):
135
def _compute_lux(self):
136
"""Based on datasheet for FN package."""
137
ch0, ch1 = self.luminosity
138
- if ch0 == 0: return 0
139
- if ch0 > TSL2561_CLIP_THRESHOLD[self.integration_time]: return 0
140
- if ch1 > TSL2561_CLIP_THRESHOLD[self.integration_time]: return 0
+ if ch0 == 0: return None
+ if ch0 > TSL2561_CLIP_THRESHOLD[self.integration_time]: return None
+ if ch1 > TSL2561_CLIP_THRESHOLD[self.integration_time]: return None
141
ratio = ch1 / ch0
142
if ratio > 0 and ratio <= 0.50:
143
lux = 0.0304 * ch0 - 0.062 * ch0 * ratio**1.4
0 commit comments