ModularSensors > Files > src / sensors / FreescaleMPL115A2.h

FreescaleMPL115A2.h file

Contains the FreescaleMPL115A2 sensor subclass and the variable subclasses FreescaleMPL115A2_Temp and FreescaleMPL115A2_Pressure.

These are used for the Freescale Semiconductor MPL115A2 Miniature I2C Digital Barometer.

This depends on the https://github.com/adafruit/Adafruit_MPL115A2 library

Classes

class FreescaleMPL115A2
The Sensor sub-class for the Freescale Semiconductor MPL115A2 sensor.
class FreescaleMPL115A2_Temp
The Variable sub-class used for the temperature output from a Freescale Semiconductor MPL115A2.
class FreescaleMPL115A2_Pressure
The Variable sub-class used for the pressure output from a Freescale Semiconductor MPL115A2.

Typedefs

using MPL115A2 = FreescaleMPL115A2 deprecated in v0.33.0
typedef for backwards compatibility; use the FreescaleMPL115A2 class in new code
using MPL115A2_Temp = FreescaleMPL115A2_Temp deprecated in v0.33.0
typedef for backwards compatibility; use the FreescaleMPL115A2_Temp class in new code
using MPL115A2_Pressure = FreescaleMPL115A2_Pressure deprecated in v0.33.0
typedef for backwards compatibility; use the FreescaleMPL115A2_Pressure class in new code

Defines

#define MPL115A2_NUM_VARIABLES = 2
Sensor::_numReturnedValues; the MPL115A2 can report 2 values.
#define MPL115A2_INC_CALC_VARIABLES = 0
Sensor::_incCalcValues; we don't calculate any additional values.

Sensor Timing

The sensor timing for a Freescale MPL115A2

#define MPL115A2_WARM_UP_TIME_MS = 6
Sensor::_warmUpTime_ms; the MPL115A2 takes about 6 ms to respond.
#define MPL115A2_STABILIZATION_TIME_MS = 0
Sensor::_stabilizationTime_ms; the MPL115A2 is stable as soon as it warms up (0ms stabilization).
#define MPL115A2_MEASUREMENT_TIME_MS = 3
Sensor::_measurementTime_ms; the MPL115A2 takes 3ms to complete a measurement.

Temperature

The temperature variable from a Freescale MPL115A2

  • Range is -20°C to 85°C
  • Accuracy is not specified on the sensor datasheet

FreescaleMPL115A2_Temp(FreescaleMPL115A2* parentSense, const char* uuid = "", const char* varCode = MPL115A2_TEMP_DEFAULT_CODE) explicit

Construct a new FreescaleMPL115A2_Temp object.

Parameters
parentSense The parent FreescaleMPL115A2 providing the result values.
uuid A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string.
varCode A short code to help identify the variable in files; optional with a default value of "FreescaleMPL115A2_Temp".

#define MPL115A2_TEMP_RESOLUTION = 2
Decimals places in string representation; temperature should have 2 - resolution is 0.01°C.
#define MPL115A2_TEMP_VAR_NUM = 0
Sensor variable number; temperature is stored in sensorValues[0].
#define MPL115A2_TEMP_VAR_NAME = "temperature"
Variable name in ODM2 controlled vocabulary; "temperature".
#define MPL115A2_TEMP_UNIT_NAME = "degreeCelsius"
Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)
#define MPL115A2_TEMP_DEFAULT_CODE = "FreescaleMPL115A2_Temp"
Default variable short code; "FreescaleMPL115A2_Temp".

Pressure

The pressure variable from a Freescale MPL115A2

  • Range is 500-1150 hPa
  • Accuracy ±10 hPa

FreescaleMPL115A2_Pressure(FreescaleMPL115A2* parentSense, const char* uuid = "", const char* varCode = MPL115A2_PRESSURE_DEFAULT_CODE) explicit

Construct a new FreescaleMPL115A2_Pressure object.

Parameters
parentSense The parent FreescaleMPL115A2 providing the result values.
uuid A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string.
varCode A short code to help identify the variable in files; optional with a default value of "FreescaleMPL115A2_Pressure".

#define MPL115A2_PRESSURE_RESOLUTION = 2
Decimals places in string representation; pressure should have 2 - resolution is 1.5 hPa.
#define MPL115A2_PRESSURE_VAR_NUM = 1
Sensor variable number; pressure is stored in sensorValues[1].
#define MPL115A2_PRESSURE_VAR_NAME = "atmosphericPressure"
Variable name in ODM2 controlled vocabulary; "atmosphericPressure".
#define MPL115A2_PRESSURE_UNIT_NAME = "kilopascal"
Variable unit name in ODM2 controlled vocabulary; "kilopascal" (kPa)
#define MPL115A2_PRESSURE_DEFAULT_CODE = "FreescaleMPL115A2_Pressure"
Default variable short code; "FreescaleMPL115A2_Pressure".