Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
BMP180 Class Reference
#include <BMP180.h>
Public Member Functions | |
| BMP180 (I2C &i2c) | |
| Create a BMP180 instance. | |
| int | initialize (float altitude=0.F, OverSamplingSetting oss=STANDARD) |
| Initialization: set member values and read BMP180 calibration parameters. | |
| int | readData (float &pTemperature, float &pPressure) |
| Read pressure and temperature from the BMP180. | |
Protected Member Functions | |
| int | ReadRawTemperature (long *pUt) |
| Perform temperature measurement. | |
| int | ReadRawPressure (long *pUp) |
| Perform pressure measurement. | |
| float | TrueTemperature (long ut) |
| Calculation of the temperature from the digital output. | |
| float | TruePressure (long up) |
| Calculation of the pressure from the digital output. | |
Detailed Description
BMP180 class.
Read Pressure and temperature from the BMP180 Breakout I2C sensor
Example:
#include "mbed.h" #include "BMP180.h" int main() { BMP180 bmp180(PIN_SDA, PIN_SCL); float pressure, temperature; // bmp180.Initialize(); // no altitude compensation and normal oversampling bmp180.Initialize(64, BMP180_OSS_ULTRA_LOW_POWER); // 64m altitude compensation and low power oversampling while(1) { if (bmp180.ReadData(&pressure, &temperature)) printf("Pressure(hPa): %8.2f \t Temperature(C): %8.2f\n", pressure, temperature); wait(1); } }
Definition at line 47 of file BMP180.h.
Constructor & Destructor Documentation
| BMP180 | ( | I2C & | i2c ) |
Member Function Documentation
| int initialize | ( | float | altitude = 0.F, |
| OverSamplingSetting | oss = STANDARD |
||
| ) |
Initialization: set member values and read BMP180 calibration parameters.
- Parameters:
-
altitude (in meter) overSamplingSetting
- Returns:
- 1 on success, 0 on error
Definition at line 13 of file BMP180.cpp.
| int readData | ( | float & | pTemperature, |
| float & | pPressure | ||
| ) |
Read pressure and temperature from the BMP180.
- Parameters:
-
pressure (hPa) temperature (C)
- Returns:
- 1 on success, 0 on error
Definition at line 46 of file BMP180.cpp.
| int ReadRawPressure | ( | long * | pUp ) | [protected] |
| int ReadRawTemperature | ( | long * | pUt ) | [protected] |
| float TruePressure | ( | long | up ) | [protected] |
Calculation of the pressure from the digital output.
Definition at line 115 of file BMP180.cpp.
| float TrueTemperature | ( | long | ut ) | [protected] |
Calculation of the temperature from the digital output.
Definition at line 105 of file BMP180.cpp.
Generated on Wed Jul 13 2022 19:46:59 by
1.7.2