upm
0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
|
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.
Public Member Functions | |
BMPX8X (int bus, int devAddr=0x77, uint8_t mode=BMP085_ULTRAHIGHRES) | |
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 | i2cWriteReg (uint8_t reg, uint8_t value) |
uint8_t | i2cReadReg_8 (int reg) |
BMPX8X | ( | int | bus, |
int | devAddr = 0x77 , |
||
uint8_t | mode = BMP085_ULTRAHIGHRES |
||
) |
Instantiates a BMPX8X object
bus | Number of the used bus |
devAddr | Address of the used I2C device |
mode | BMP085 mode |
int32_t getPressure | ( | ) |
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 | ( | ) |
Gets raw pressure data
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
altitudeMeters | Altitude |
float getAltitude | ( | float | sealevelPressure = 101325 | ) |
With a given sea level, altitude in meters can be calculated
sealevelPressure | Sea level |
int32_t computeB5 | ( | int32_t | UT | ) |
Calculates B5 (check the spec for more information)
UT |
uint16_t i2cReadReg_16 | ( | int | reg | ) |
Reads a two-byte register
reg | Address of the register |
mraa::Result i2cWriteReg | ( | uint8_t | reg, |
uint8_t | value | ||
) |
Writes to a one-byte register
reg | Address of the register |
value | Byte to be written |
uint8_t i2cReadReg_8 | ( | int | reg | ) |
Reads a one-byte register
reg | Address of the register |