Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'calculateLux' unexpected overflow behavior due to use of uint16_t #41

Open
atomdog opened this issue Jun 15, 2023 · 0 comments
Open

'calculateLux' unexpected overflow behavior due to use of uint16_t #41

atomdog opened this issue Jun 15, 2023 · 0 comments

Comments

@atomdog
Copy link

atomdog commented Jun 15, 2023

  • Arduino board: ESP32

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.16

  • List the steps to reproduce the problem below:
    In dark conditions a call to apds.calculateLux inverts values and returns values at or near 65534.
    You can reproduced this via:
    uint16_t lux = apds.calculateLux(r, g, b); or uint32_t lux = apds.calculateLux(r, g, b);

    This is a straightforward fix and I can make a pull request if this repo is still being maintained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant