Skip to content

Commit c70c7c7

Browse files
authored
Merge pull request #3 from caternuson/iss2
Remove visible_light property
2 parents db0b566 + 61aebc6 commit c70c7c7

5 files changed

+1
-18
lines changed

adafruit_ltr329_ltr303.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,6 @@ def ir_light(self) -> int:
175175
raise ValueError("Data invalid / over-run!")
176176
return self._light_data & 0xFFFF
177177

178-
@property
179-
def visible_light(self) -> int:
180-
"""The visible light data"""
181-
temp = self._light_data
182-
if self.als_data_invalid:
183-
raise ValueError("Data invalid / over-run!")
184-
infra = temp & 0xFFFF
185-
vis_infra = temp >> 16
186-
return vis_infra - infra
187-
188178

189179
class LTR303(LTR329):
190180
"""Base driver for the LTR-303 light sensor, basically an LTR-329 with INT out

examples/ltr303_advancedtest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
# Now we can do various math...
7171
print("Visible + IR:", visible_plus_ir)
7272
print("Infrared :", ir)
73-
print("Visible :", visible_plus_ir - ir)
7473
print("ALS gain: :", ltr303.als_data_gain)
7574
print()
7675
except ValueError:

examples/ltr303_simpletest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@
1414
while True:
1515
print("Visible + IR:", ltr303.visible_plus_ir_light)
1616
print("Infrared :", ltr303.ir_light)
17-
print("Visible :", ltr303.visible_light)
1817
print()
1918
time.sleep(0.5) # sleep for half a second

examples/ltr329_advancedtest.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@
44

55
import time
66
import board
7-
from adafruit_debug_i2c import DebugI2C
87
import adafruit_ltr329_ltr303 as adafruit_ltr329
98

109
i2c = board.I2C() # uses board.SCL and board.SDA
1110

12-
debug_i2c = DebugI2C(i2c)
13-
1411
time.sleep(0.1) # sensor takes 100ms to 'boot' on power up
15-
ltr329 = adafruit_ltr329.LTR329(debug_i2c)
12+
ltr329 = adafruit_ltr329.LTR329(i2c)
1613

1714
# Can set the ALS light gain, can be: 1, 2, 4, 8, 48 or 96 times
1815
# to range from 1~64 kLux to 0.01~600 Lux
@@ -56,7 +53,6 @@
5653
# Now we can do various math...
5754
print("Visible + IR:", visible_plus_ir)
5855
print("Infrared :", ir)
59-
print("Visible :", visible_plus_ir - ir)
6056
print("ALS gain: :", ltr329.als_data_gain)
6157
print()
6258
except ValueError:

examples/ltr329_simpletest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@
1414
while True:
1515
print("Visible + IR:", ltr329.visible_plus_ir_light)
1616
print("Infrared :", ltr329.ir_light)
17-
print("Visible :", ltr329.visible_light)
1817
print()
1918
time.sleep(0.5) # sleep for half a second

0 commit comments

Comments
 (0)