Comments (2)
Looking at the equation, there are a few things missing.
- The Gain is not used in the equation for Lux, it likely should be (maybe just divide the computation by the gain?)
- 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.
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)
- ESP8266 - SparkFun_APDS9960.h:202:1: error: expected declaration before '}' token HOT 2
- Proximity and gesture at the same time doesn't work HOT 3
- Would you consider adding a lux demo? HOT 1
- Can you please provide an example of how to use Wire's setPins? HOT 2
- Incorrect bit field definitions HOT 3
- Gesture Sensing & Code Blocking HOT 3
- The Arduino code has no option to use alternate pins on the micro contorller HOT 1
- Convert to BusIO HOT 1
- Remove I2C chunkification HOT 1
- Adjustment of the gesture detection
- Gestures, color and proximity at the same time
- Use all sensors
- 'calculateLux' unexpected overflow behavior due to use of uint16_t
- calculateLux does not reflect APDS sensor documentation HOT 8
- The Color Data returned is formatted incorrectly (i think) HOT 2
- Sensor's loop take control of the main arduino loop ? HOT 2
- gconf1::get() is incorrect. HOT 3
- IR Pulse width HOT 3
- Adjust Proximity gain HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adafruit_apds9960.