Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove visible_light property #3

Merged
merged 1 commit into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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