API for the GY65/BMP085 and BMP180 Atmospheric Pressure Sensors.
More...
Bosch GY65/BMP085 and BMP180 are high-precision, ultra-low power consumption pressure sensors. They operate in the range of 30,000-110,000 Pa.
This module has been tested on the GY65/BMP085 and BMP180 sensors.
uint32_t presure = 0;
float temperature = 0;
float altitude = 0;
uint32_t sealevel = 0;
while (!doWork) {
sealevel = sensor->getSealevelPressure ();
std::cout << "pressure value = " <<
presure <<
", altitude value = " <<
altitude <<
", sealevel value = " <<
sealevel <<
", temperature = " <<
temperature << std::endl;
usleep (100000);
}
BMPX8X |
( |
int |
bus, |
|
|
int |
devAddr = 0x77 , |
|
|
uint8_t |
mode = BMP085_ULTRAHIGHRES |
|
) |
| |
Instantiates a BMPX8X object
- Parameters
-
bus | Number of the used bus |
devAddr | Address of the used I2C device |
mode | BMP085 mode |
BMPX8X object destructor; basically, it closes the I2C connection. ~BMPX8X (); LE: there is no need for the destructor, as the I2C connection will be closed when the m_i2ControlCtx variable will go out of scope (when all the BMPX8X objects will be destroyed) Returns the calculated pressure
int32_t getPressureRaw |
( |
| ) |
|
int16_t getTemperatureRaw |
( |
| ) |
|
Gets raw temperature data from the sensor
float getTemperature |
( |
void |
| ) |
|
Returns the calculated temperature
int32_t getSealevelPressure |
( |
float |
altitudeMeters = 0 | ) |
|
With a given absolute altitude, sea level can be calculated
- Parameters
-
float getAltitude |
( |
float |
sealevelPressure = 101325 | ) |
|
With a given sea level, altitude in meters can be calculated
- Parameters
-
sealevelPressure | Sea level |
int getTemperatureCelsius |
( |
| ) |
|
|
virtual |
const char * getModuleName |
( |
| ) |
|
|
virtual |
Returns name of module. This is the string in library name after libupm_
- Returns
- name of module
Implements IModuleStatus.
int32_t computeB5 |
( |
int32_t |
UT | ) |
|
Calculates B5 (check the spec for more information)
- Parameters
-
uint16_t i2cReadReg_16 |
( |
int |
reg | ) |
|
Reads a two-byte register
- Parameters
-
reg | Address of the register |
mraa::Result i2cWriteReg |
( |
uint8_t |
reg, |
|
|
uint8_t |
value |
|
) |
| |
Writes to a one-byte register
- Parameters
-
reg | Address of the register |
value | Byte to be written |
uint8_t i2cReadReg_8 |
( |
int |
reg | ) |
|
Reads a one-byte register
- Parameters
-
reg | Address of the register |
The documentation for this class was generated from the following files:
- /iotdk/jenkins/workspace/upm-doc-stable/src/bmpx8x/bmpx8x.hpp
- /iotdk/jenkins/workspace/upm-doc-stable/src/bmpx8x/bmpx8x.cxx