Skip to content

Commit

Permalink
Merge pull request #3 from caternuson/iss2
Browse files Browse the repository at this point in the history
Remove visible_light property
  • Loading branch information
kattni authored Oct 4, 2022
2 parents db0b566 + 61aebc6 commit c70c7c7
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 18 deletions.
10 changes: 0 additions & 10 deletions adafruit_ltr329_ltr303.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,6 @@ def ir_light(self) -> int:
raise ValueError("Data invalid / over-run!")
return self._light_data & 0xFFFF

@property
def visible_light(self) -> int:
"""The visible light data"""
temp = self._light_data
if self.als_data_invalid:
raise ValueError("Data invalid / over-run!")
infra = temp & 0xFFFF
vis_infra = temp >> 16
return vis_infra - infra


class LTR303(LTR329):
"""Base driver for the LTR-303 light sensor, basically an LTR-329 with INT out
Expand Down
1 change: 0 additions & 1 deletion examples/ltr303_advancedtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
# Now we can do various math...
print("Visible + IR:", visible_plus_ir)
print("Infrared :", ir)
print("Visible :", visible_plus_ir - ir)
print("ALS gain: :", ltr303.als_data_gain)
print()
except ValueError:
Expand Down
1 change: 0 additions & 1 deletion examples/ltr303_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
while True:
print("Visible + IR:", ltr303.visible_plus_ir_light)
print("Infrared :", ltr303.ir_light)
print("Visible :", ltr303.visible_light)
print()
time.sleep(0.5) # sleep for half a second
6 changes: 1 addition & 5 deletions examples/ltr329_advancedtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@

import time
import board
from adafruit_debug_i2c import DebugI2C
import adafruit_ltr329_ltr303 as adafruit_ltr329

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

debug_i2c = DebugI2C(i2c)

time.sleep(0.1) # sensor takes 100ms to 'boot' on power up
ltr329 = adafruit_ltr329.LTR329(debug_i2c)
ltr329 = adafruit_ltr329.LTR329(i2c)

# Can set the ALS light gain, can be: 1, 2, 4, 8, 48 or 96 times
# to range from 1~64 kLux to 0.01~600 Lux
Expand Down Expand Up @@ -56,7 +53,6 @@
# Now we can do various math...
print("Visible + IR:", visible_plus_ir)
print("Infrared :", ir)
print("Visible :", visible_plus_ir - ir)
print("ALS gain: :", ltr329.als_data_gain)
print()
except ValueError:
Expand Down
1 change: 0 additions & 1 deletion examples/ltr329_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
while True:
print("Visible + IR:", ltr329.visible_plus_ir_light)
print("Infrared :", ltr329.ir_light)
print("Visible :", ltr329.visible_light)
print()
time.sleep(0.5) # sleep for half a second

0 comments on commit c70c7c7

Please sign in to comment.