ModularSensors > Files > sensors / FreescaleMPL115A2.h

FreescaleMPL115A2.h file

Contains the MPL115A2 sensor subclass and the variable subclasses MPL115A2_Temp and MPL115A2_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 MPL115A2
The Sensor sub-class for the Freescale Semiconductor MPL115A2 sensor.
class MPL115A2_Temp
The Variable sub-class used for the temperature output from a Freescale Semiconductor MPL115A2.
class MPL115A2_Pressure
The Variable sub-class used for the pressure output from a Freescale Semiconductor MPL115A2.

Defines

#define MPL115A2_NUM_VARIABLES = 2
Sensor::_numReturnedValues; the MPL115A2 can report 2 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

MPL115A2_Temp(MPL115A2* parentSense, const char* uuid = "", const char* varCode = MPL115A2_TEMP_DEFAULT_CODE) explicit

Construct a new MPL115A2_Temp object.

Parameters
parentSense The parent MPL115A2 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 "MPL115A2_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 = "MPL115A2_Temp"
Default variable short code; "MPL115A2_Temp".

Pressure

The pressure variable from a Freescale MPL115A2

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

MPL115A2_Pressure(MPL115A2* parentSense, const char* uuid = "", const char* varCode = MPL115A2_PRESSURE_DEFAULT_CODE) explicit

Construct a new MPL115A2_Pressure object.

Parameters
parentSense The parent MPL115A2 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 "MPL115A2_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 = "MPL115A2_Pressure"
Default variable short code; "MPL115A2_Pressure".