GithubHelp home page GithubHelp logo

Comments (13)

RobCranfill avatar RobCranfill commented on July 4, 2024

I am running adafruit_veml7700 1.1.4 (the latest), as I have been for months. This stopped working a week or two ago.

from adafruit_circuitpython_veml7700.

caternuson avatar caternuson commented on July 4, 2024

Did you change anything else? Try updating your CP firmware and libraries to all latest versions.

Can't recreate this with a quick test:

Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit QT Py M0 with samd21e18
>>> import board
>>> import adafruit_veml7700
>>> veml = adafruit_veml7700.VEML7700(board.I2C())
>>> veml.light
5507
>>> veml.lux
317.491
>>> 

EDIT As another test/check - try printing the light_integration_time before the call to lux.

while True:
    print("Light Integration Time:", veml7700.light_integration_time)
    print("Ambient light:", veml7700.lux)
    time.sleep(1.0)

from adafruit_circuitpython_veml7700.

RobCranfill avatar RobCranfill commented on July 4, 2024

from adafruit_circuitpython_veml7700.

caternuson avatar caternuson commented on July 4, 2024

Python3 on a Raspberry Pi should be fine, assuming you are using via Blinka:
https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/overview

Just did a quick test on a Pi with Python3 and still seems to work OK:

(blinka) pi@raspberrypi:~ $ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> import adafruit_veml7700
>>> veml = adafruit_veml7700.VEML7700(board.I2C())
>>> veml.light
5435
>>> veml.lux
312.192
>>> veml.light_integration_time
0
>>> 

version check:

(blinka) pi@raspberrypi:~ $ pip3 list | grep veml
adafruit-circuitpython-veml7700  1.1.7    

from adafruit_circuitpython_veml7700.

RobCranfill avatar RobCranfill commented on July 4, 2024

from adafruit_circuitpython_veml7700.

caternuson avatar caternuson commented on July 4, 2024

No. They are not the same.

Have you tried printing the value of light_integration_time prior to the call to lux? Do you also get 0 as shown above?

from adafruit_circuitpython_veml7700.

RobCranfill avatar RobCranfill commented on July 4, 2024

from adafruit_circuitpython_veml7700.

RobCranfill avatar RobCranfill commented on July 4, 2024

from adafruit_circuitpython_veml7700.

caternuson avatar caternuson commented on July 4, 2024

Yes, getting a 4 would be an issue. That is not a valid setting, which is what is throwing the key error. 0 is a valid setting. The valid settings are:

    ALS_25MS = const(0xC)
    ALS_50MS = const(0x8)
    ALS_100MS = const(0x0)
    ALS_200MS = const(0x1)
    ALS_400MS = const(0x2)
    ALS_800MS = const(0x3)

So the question is how it got set to 4 in the first place? Were you doing that?

from adafruit_circuitpython_veml7700.

RobCranfill avatar RobCranfill commented on July 4, 2024

from adafruit_circuitpython_veml7700.

caternuson avatar caternuson commented on July 4, 2024

See if you can recreate the issue. If so, we can continue to take a look. If not, then, yes, please close. Also, nothing really urgent here, so OK to keep this open for a little while if you want to continue exercise things and see if it happens again.

from adafruit_circuitpython_veml7700.

RobCranfill avatar RobCranfill commented on July 4, 2024

from adafruit_circuitpython_veml7700.

RobCranfill avatar RobCranfill commented on July 4, 2024

Cannot reproduce. Immediate cause of error, as mentioned above, was light_integration_time having a value of 4, which is not valid. I don't know how that happened, and I have not bee able to reproduce it.

from adafruit_circuitpython_veml7700.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.