Library to wrapper most of the functions on the MPL3115A2 pressure and temperature sensor.
Dependents: WeatherBalloon4180 WeatherBalloon4180 mbed_rifletool Smart_Watch_4180_Final_Design ... more
Pressure Class Reference
Pressure provides a wrapper around barometric data coming from the sensor. More...
#include <Pressure.h>
Public Types | |
enum | unitsType |
The units we support converting the sensor data to. More... | |
Public Member Functions | |
operator char * (void) | |
Allows using the object directly in an I2C read operation. | |
operator float (void) | |
Same as calling pressure with PASCALS as the parameter. | |
void | setPressure () |
Call to decompress the sensor data after an I2C read. | |
const char * | print (unitsType units=PASCALS) |
Returns the pressure as a string in the units specified, defaulting to PASCAL if none specified. | |
Static Public Attributes | |
static const int | size = 3 |
The size of the compressed data buffer from the sensor. Used in an I2C read. |
Detailed Description
Pressure provides a wrapper around barometric data coming from the sensor.
The class handles working with compressed data from the sensor and provides convenient functions for retreiving the data in various units (with room to add more if needed).
Definition at line 20 of file Pressure.h.
Member Enumeration Documentation
enum unitsType |
The units we support converting the sensor data to.
Definition at line 28 of file Pressure.h.
Member Function Documentation
operator char * | ( | void | ) |
Allows using the object directly in an I2C read operation.
Definition at line 36 of file Pressure.h.
operator float | ( | void | ) |
Same as calling pressure with PASCALS as the parameter.
Definition at line 38 of file Pressure.h.
const char * print | ( | unitsType | units = PASCALS ) |
Returns the pressure as a string in the units specified, defaulting to PASCAL if none specified.
Definition at line 69 of file Pressure.cpp.
void setPressure | ( | ) |
Call to decompress the sensor data after an I2C read.
Definition at line 28 of file Pressure.cpp.
Field Documentation
const int size = 3 [static] |
The size of the compressed data buffer from the sensor. Used in an I2C read.
Definition at line 25 of file Pressure.h.
Generated on Tue Jul 12 2022 19:49:10 by 1.7.2