#include <src/sensors/MeaSpecMS5803.h>
MeaSpecMS5803
class
The Sensor sub-class for the Measurement Specialties MS5803 sensor.
- 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
- MeaSpecMS5803(int8_t powerPin, uint8_t i2cAddressHex = 0x76, int16_t maxPressure = 14, uint8_t measurementsToAverage = 1) explicit
- Construct a new MeaSpecMS5803 object.
- ~MeaSpecMS5803()
- Destroy the MeaSpecMS5803 object.
Public functions
- 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 addSingleMeasurementResult(void) -> bool override
- Get the results from a single measurement.
Function documentation
MeaSpecMS5803:: MeaSpecMS5803(int8_t powerPin,
uint8_t i2cAddressHex = 0x76,
int16_t maxPressure = 14,
uint8_t measurementsToAverage = 1) explicit
Construct a new MeaSpecMS5803 object.
Parameters | |
---|---|
powerPin | The pin on the mcu controlling power to the MS5803 Use -1 if it is continuously powered.
|
i2cAddressHex | The I2C address of the MS5803; must be either 0x76 or 0x77. The default value is 0x76. |
maxPressure | The maximum pressure of the specific MS5803 in bar. The sensors are maufactured with maximum pressures of 1.1 bar, 1.3 bar, 5 bar, 7 bar, 14 bar, and 30 bar. |
measurementsToAverage | The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1. |
bool MeaSpecMS5803:: 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 sets the pin modes for _
String MeaSpecMS5803:: 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 MeaSpecMS5803:: 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 _