Giter VIP home page Giter VIP logo

Comments (2)

Rvice avatar Rvice commented on May 21, 2024

Looking at the equation, there are a few things missing.

  1. The Gain is not used in the equation for Lux, it likely should be (maybe just divide the computation by the gain?)
  2. Overflow on any channel (visual, red, green and blue) are not checked for. This is a function of aTime (not values for 219 and 246 for atime do not reflect the equation 1025 * cycles)

Regarding actual measurements, I cannot comment on these.

The equation (calculateLux) should change to something like (with the visual channel added, maybe it shouldn't be):

// where gain is 1, 4, 16, 64
// where atime is the actual setting
max_count = 1025*(256-atime);

if(max_count >= 65535)
{
    max_count = 65535;
}

if(visual >= max_count || r >= max_count || g >= max_count || b >= max_count)
{
    return "OverFlow"
}
Lux = ((-0.32466f * r) + (1.57837f * g) + (-0.73191f * b)) / gain;

from adafruit_apds9960.

gschorcht avatar gschorcht commented on May 21, 2024

The ALS integration time is not taken into account too. This will also lead to incorrect values if the application does not scale down the RGB values correctly before calling the calculateLux or calculateColorTemperature method. Even with the default value of 10 for the iTimeMS parameter in the begin method, the RGB count values are already integrated over 3 ADC conversions.

from adafruit_apds9960.

Related Issues (20)

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.