upm  0.2.0
Sensor/Actuator repository for libmraa (v0.6.1)
Public Member Functions

C++ API for GY65/BMP085 and BMP180 chips (Atmospheric Pressure Sensor) More...

Detailed Description

The Bosch GY65/BMP085 and BMP180 are high precision, ultra-low power consumption pressure sensors. They have a range of between 30,000 and 110,000 Pa.

This module has been tested on the GY65/BMP085 and BMP180 sensors.

bmp085.jpeg
uint32_t presure = 0;
float temperature = 0;
float altitude = 0;
uint32_t sealevel = 0;
// Instantiate a BMPX8X sensor on I2C
sensor = new upm::BMPX8X(0, ADDR);
// Print the pressure, altitude, sea level, and
// temperature values every 0.1 seconds
while (!doWork) {
presure = sensor->getPressure ();
temperature = sensor->getTemperature ();
altitude = sensor->getAltitude ();
sealevel = sensor->getSealevelPressure ();
std::cout << "pressure value = " <<
presure <<
", altitude value = " <<
altitude <<
", sealevel value = " <<
sealevel <<
", temperature = " <<
temperature << std::endl;
usleep (100000);
}

Public Member Functions

 BMPX8X (int bus, int devAddr=0x77, uint8_t mode=BMP085_ULTRAHIGHRES)
 
 ~BMPX8X ()
 
int32_t getPressure ()
 
int32_t getPressureRaw ()
 
int16_t getTemperatureRaw ()
 
float getTemperature ()
 
int32_t getSealevelPressure (float altitudeMeters=0)
 
float getAltitude (float sealevelPressure=101325)
 
int32_t computeB5 (int32_t UT)
 
uint16_t i2cReadReg_16 (int reg)
 
mraa_result_t i2cWriteReg (uint8_t reg, uint8_t value)
 
uint8_t i2cReadReg_8 (int reg)
 

Constructor & Destructor Documentation

BMPX8X ( int  bus,
int  devAddr = 0x77,
uint8_t  mode = BMP085_ULTRAHIGHRES 
)

Instanciates a BMPX8X object

Parameters
busnumber of used bus
devAddraddress of used i2c device
modeBMP085 mode

Here is the call graph for this function:

~BMPX8X ( )

BMPX8X object destructor, basicaly it close i2c connection.

Member Function Documentation

int32_t getPressure ( )

Return calculated pressure

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t getPressureRaw ( )

Get raw pressure data

Here is the call graph for this function:

Here is the caller graph for this function:

int16_t getTemperatureRaw ( )

Get raw temperature data from chip

Here is the call graph for this function:

Here is the caller graph for this function:

float getTemperature ( void  )

Return calculated temperature

Here is the call graph for this function:

int32_t getSealevelPressure ( float  altitudeMeters = 0)

With given absolute altitude sea level can be calculated

Parameters
altitudeMetersaltitude

Here is the call graph for this function:

float getAltitude ( float  sealevelPressure = 101325)

With given sea level altitude in meters can be calculated

Parameters
sealevelPressureSea level

Here is the call graph for this function:

int32_t computeB5 ( int32_t  UT)

Calculation of B5 (check spec for more information)

Parameters
UT

Here is the caller graph for this function:

uint16_t i2cReadReg_16 ( int  reg)

Read two bytes register

Parameters
regaddress of a register

Here is the caller graph for this function:

mraa_result_t i2cWriteReg ( uint8_t  reg,
uint8_t  value 
)

Write to one byte register

Parameters
regaddress of a register
valuebyte to be written

Here is the caller graph for this function:

uint8_t i2cReadReg_8 ( int  reg)

Read one byte register

Parameters
regaddress of a register

Here is the caller graph for this function:


The documentation for this class was generated from the following files: