Class that stores state and functions for interacting with MPL3115A2 altimeter.
More...
#include <Adafruit_MPL3115A2.h>
Class that stores state and functions for interacting with MPL3115A2 altimeter.
◆ begin()
boolean Adafruit_MPL3115A2::begin |
( |
TwoWire * |
twoWire = &Wire | ) |
|
Setups the HW (reads coefficients values, etc.)
- Parameters
-
twoWire | Optional TwoWire I2C object |
- Returns
- true on successful startup, false otherwise
◆ getPressure()
float Adafruit_MPL3115A2::getPressure |
( |
void |
| ) |
|
Get barometric pressure.
- Returns
- pressure reading as a floating point value in hPa
◆ getAltitude()
float Adafruit_MPL3115A2::getAltitude |
( |
void |
| ) |
|
Get altitude.
- Returns
- altitude reading as a floating-point value in meters
◆ getAltitudeOffset()
int8_t Adafruit_MPL3115A2::getAltitudeOffset |
( |
void |
| ) |
|
Get the altitude offset.
- Returns
- Offset value in meters
◆ setAltitudeOffset()
void Adafruit_MPL3115A2::setAltitudeOffset |
( |
int8_t |
offset | ) |
|
Set the altitude offset.
- Parameters
-
offset | Offset value in meters, from -127 to 128 |
◆ getTemperature()
float Adafruit_MPL3115A2::getTemperature |
( |
void |
| ) |
|
Get temperature.
- Returns
- temperature reading as a floating-point value in degC
◆ setSeaPressure()
void Adafruit_MPL3115A2::setSeaPressure |
( |
float |
SLP | ) |
|
Set the local sea level pressure.
- Parameters
-
SLP | sea level pressure in hPa |
◆ setMode()
Set measurement mode.
- Parameters
-
mode | The measurement mode. Can be MPL3115A2_BAROMETER or MPL3115A2_ALTIMETER. |
◆ conversionComplete()
bool Adafruit_MPL3115A2::conversionComplete |
( |
void |
| ) |
|
Check for measurement conversion completion.
- Returns
- true if conversion is complete, otherwise false.
◆ getLastConversionResults()
float Adafruit_MPL3115A2::getLastConversionResults |
( |
mpl3115a2_meas_t |
value = MPL3115A2_PRESSURE | ) |
|
Get results from last measurement.
- Parameters
-
value | Measurement value, can be MPL3115A2_PRESSURE, MPL3115A2_ALTITUDE, or MPL3115A2_TEMPERATURE |
- Returns
- The measurement value.
◆ write8()
void Adafruit_MPL3115A2::write8 |
( |
uint8_t |
a, |
|
|
uint8_t |
d |
|
) |
| |
write a byte of data to the specified address
- Parameters
-
a | the address to write to |
d | the byte to write |
The documentation for this class was generated from the following files: