FACTORS FOR CALCULATION OF LUX(9)
π NAME π
Factors for calculation of lux β like, the whole rundown on how lux actually gets calculated, straight out of the Kernel API Manual bestie β¨
(also it's filed under Factors for ...ation of lux(9) in the header/footer if you're looking for it, no cap π)
πΈ DESCRIPTION πΈ
Okay so first thing: static const int veml6046x00_it_gains β that's the array, and it contains the factors for calculation of lux. That's its whole job. Iconic of it honestly π
Here's the vibe: depending on the set up integration time (IT), the gain, and the photodiode size (PD), the measured raw values come out different even when the light is literally constant. Like, same light, different numbers?? that's just how it is bestie π
But plot twist β the gain and the PD are already coupled together in the driver (peep struct veml6046x00_gain_pd), so that leaves only two dimensions remaining:
- IT
- gain(driver)
Periodt. Two.
The array of available factors for a certain IT are grouped together in the same form as expected by the callback of scale_available (IIO_CHAN_INFO_SCALE) β so it just slots right in, no drama π«Ά
And the factors for lux / raw count? Taken directly from the datasheet. fr fr, no guessing, no vibes-based math π₯
No cap: the raw count only means something once you've got the right factor for your IT + gain situation, so don't skip this part π
π¦ SEE ALSO π¦
- Kernel file
./drivers/iio/light/veml6046x00.c struct veml6046x00_rf(9)struct veml6046x00_data(9)Valid integration times (IT)(9)Handling of gain and photodiode size (PD)(9)struct veml6046x00_gain_pd(9)veml6046x00_read_data_ready(9)veml6046x00_wait_data_available(9)
That's the whole page, bestie, go read the related ones too, iykyk π
Source path: ./drivers/iio/light Β· dated October 2026 Β· shown as Factors for ...ation of lux(9) β mwah, bye! πππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms