-
Notifications
You must be signed in to change notification settings - Fork 310
Return NaN only if sampling is disabled #115
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
Conversation
|
Should close #114 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the behavior for sensor reading functions so that NAN is returned when sampling is disabled rather than detecting invalid ADC values, and adjusts the associated documentation.
- Update the sampling condition checks in readTemperature, readPressure, and readHumidity to return NAN if sampling is off.
- Modify the header comments to correctly describe humidity oversampling.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Adafruit_BME280.h | Updated the comment for osrs_h to reflect humidity oversampling correctly. |
| Adafruit_BME280.cpp | Added early sampling mode checks in sensor reading functions to return NAN. |
Files not reviewed (1)
- library.properties: Language not supported
|
@ladyada ready for review |
This changes the functionality for pressure/temperature/humidity from returning NaN at key values (fixed values returned when sampling rate is None/Skip), to returning NaN if sampling is off.
Minor docstring changes too.
Tested on MetroS3 w/BME280, using simple test and advanced test with humidty test scenario (shows pressure and altitude return nan as pressure sampling is off).
Not verified that exactly 80% relative humidity can be returned (but logically ok).