Attribute Error: module 'ltr559' has not attribute 'tet_lux'

Working on an Enviro+, examples work fine so I know that get_lux and get_proximity work, but when I try to run them myself in python I keep getting this error.

>>> import time
>>> import ltr559
>>> while True:
...     print(ltr559.get_lux(), ltr559.get_proximity())
...     time.sleep(1)
...
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
AttributeError: module 'ltr559' has no attribute 'get_lux'

Give this example a try.
ltr559-python/examples/proximity-and-light.py at main · pimoroni/ltr559-python · GitHub

from ltr559 import LTR559

ltr559 = LTR559()

This was what I needed, thanks.

1 Like

Good stuff, have fun.