#include <src/sensors/BoschBMP3xx.h>
BoschBMP3xx
class
The Sensor sub-class for the Bosch BMP3xx.
- Reference
- Detailed Descriptions
Base classes
- class Sensor
- The "Sensor" class is used for all sensor-level operations - waking, sleeping, and taking measurements.
Constructors, destructors, conversion operators
- BoschBMP3xx(int8_t powerPin, Mode mode = FORCED_MODE, Oversampling pressureOversample = OVERSAMPLING_X16, Oversampling tempOversample = OVERSAMPLING_X2, IIRFilter filterCoeff = IIR_FILTER_OFF, TimeStandby timeStandby = TIME_STANDBY_10MS, uint8_t i2cAddressHex = 0x76) explicit
- Construct a new Bosch BMP3xx object using the primary hardware I2C instance.
- ~BoschBMP3xx()
- Destroy the Bosch BMP3xx object.
Public functions
- bool wake(void) -> bool override
- Wake the sensor up, if necessary. Do whatever it takes to get a sensor in the proper state to begin a measurement.
- bool setup(void) -> bool override
- Do any one-time preparations needed before the sensor will be able to take readings.
- String getSensorLocation(void) -> String override
- Get the pin or connection location between the mcu and the sensor.
- bool startSingleMeasurement(void) -> bool override
- Tell the sensor to start a single measurement, if needed.
- bool addSingleMeasurementResult(void) -> bool override
- Get the results from a single measurement.
Function documentation
BoschBMP3xx:: BoschBMP3xx(int8_t powerPin,
Mode mode = FORCED_MODE,
Oversampling pressureOversample = OVERSAMPLING_X16,
Oversampling tempOversample = OVERSAMPLING_X2,
IIRFilter filterCoeff = IIR_FILTER_OFF,
TimeStandby timeStandby = TIME_STANDBY_10MS,
uint8_t i2cAddressHex = 0x76) explicit
Construct a new Bosch BMP3xx object using the primary hardware I2C instance.
Parameters | |
---|---|
powerPin | The pin on the mcu controlling power to the BMP3XX Use -1 if it is continuously powered.
|
mode | Data sampling mode
|
pressureOversample | Pressure oversampling setting
|
tempOversample | Temperature oversampling setting Possible values are the same as those for pressureOversample. Using temperature oversampling above X2 is not recommended as it does not further improve pressure data quality. |
filterCoeff | Coefficient of the infinite impulse response (IIR) filter (in samples).
|
timeStandby | Standby time between measurements when continuously powered and operating in normal mode.
|
i2cAddressHex | The I2C address of the BMP3xx; must be either 0x76 or 0x77. The default value is 0x76. |
bool BoschBMP3xx:: wake(void) override
Wake the sensor up, if necessary. Do whatever it takes to get a sensor in the proper state to begin a measurement.
Returns | bool True if the wake function completed successfully. |
---|
Verifies that the power is on and updates the _
bool BoschBMP3xx:: setup(void) override
Do any one-time preparations needed before the sensor will be able to take readings.
Returns | bool True if the setup was successful. |
---|
This begins the Wire library (sets pin modes for I2C), reads calibration coefficients from the BMP3xx, and updates the _
String BoschBMP3xx:: getSensorLocation(void) override
Get the pin or connection location between the mcu and the sensor.
Returns | String Text describing how the sensor is attached to the mcu. |
---|
bool BoschBMP3xx:: startSingleMeasurement(void) override
Tell the sensor to start a single measurement, if needed.
Returns | bool True if the start measurement function completed successfully. |
---|
This also sets the _
bool BoschBMP3xx:: addSingleMeasurementResult(void) override
Get the results from a single measurement.
Returns | bool True if the function completed successfully. |
---|
This asks the sensor for a new result, verifies that it passes sanity range checks, and then adds the value to the result array.
This also un-sets the _