Add ability to specify the pressure offset at initialization#20
Add ability to specify the pressure offset at initialization#20patrickxia wants to merge 1 commit into
Conversation
Fixes adafruit#19. The SCD30 only allows you to do this at startup, but the pressure offset is hard-coded in the library. Add an optional pressure offset to Adafruit_SCD30::begin. This is an API-breaking change, since objects that override Adafruit_SCD30::_init will have the wrong signature. This is done intentionally; any objects that override _init need to take into account the new argument to Adafruit_SCD30::begin. Also get rid of the unused decl for getAmbiendPressure.
|
The ambient pressure can be specified as a parameter to |
|
Sure, but that means that whenever you init you explicitly write a zero into the device register and the scd30 will start recording data with the default pressure offset. This is fine because the start command zeroes out the read buffer, so as long as you don't read between begin and the reset, your data won't be bad, but the general approach seems a bit redundant. But for API stability I guess the proposed approach works in the status quo. It might be nice to explicitly have as a comment that startContinuousMeasurement (a) clears out the read buffer, and (b) can be called while measurements are already started. |
Fixes #19.
The SCD30 only allows you to do this at startup, but the pressure offset is hard-coded in the library. Add an optional pressure offset to Adafruit_SCD30::begin.
This is an API-breaking change, since objects that override Adafruit_SCD30::_init will have the wrong signature. This is done intentionally; any objects that override _init need to take into account the new argument to Adafruit_SCD30::begin.
Also get rid of the unused decl for getAmbiendPressure.