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
Temperature Class Reference
Temperature provides a wrapper around temperature data coming from the sensor. More...
#include <Temperature.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 temperature with FAHRENHEIT as the parameter. | |
void | setTemperature () |
Call to decompress the sensor data after an I2C read. | |
const char * | print (unitsType units=FAHRENHEIT) |
Returns the temperature as a string in the units specified, defaulting to FAHRENHEIT if none specified. | |
Static Public Attributes | |
static const int | size = 2 |
The size of the compressed data buffer from the sensor. Used in an I2C read. |
Detailed Description
Temperature provides a wrapper around temperature 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 Temperature.h.
Member Enumeration Documentation
enum unitsType |
The units we support converting the sensor data to.
Definition at line 28 of file Temperature.h.
Member Function Documentation
operator char * | ( | void | ) |
Allows using the object directly in an I2C read operation.
Definition at line 36 of file Temperature.h.
operator float | ( | void | ) |
Same as calling temperature with FAHRENHEIT as the parameter.
Definition at line 38 of file Temperature.h.
const char * print | ( | unitsType | units = FAHRENHEIT ) |
Returns the temperature as a string in the units specified, defaulting to FAHRENHEIT if none specified.
Definition at line 62 of file Temperature.cpp.
void setTemperature | ( | ) |
Call to decompress the sensor data after an I2C read.
Definition at line 27 of file Temperature.cpp.
Field Documentation
const int size = 2 [static] |
The size of the compressed data buffer from the sensor. Used in an I2C read.
Definition at line 25 of file Temperature.h.
Generated on Tue Jul 12 2022 19:49:10 by
![doxygen](doxygen.png)