atMETEO
An ATmega based weather station
Files | Classes
BMP180 Digital pressure sensor

Avr::Bmp180 decodes data from Bosch BMP180 Digital pressure sensors. More...

Collaboration diagram for BMP180 Digital pressure sensor:

Files

file  bmp180.h
 Avr::Bmp180 decodes data from Bosch BMP180 Digital pressure sensors.
 

Classes

class  Avr::Bmp180
 Decodes data from Bosch BMP180 Digital pressure sensors. More...
 

Detailed Description

Avr::Bmp180 decodes data from Bosch BMP180 Digital pressure sensors.


Class Documentation

◆ Avr::Bmp180

class Avr::Bmp180

Public Types

enum  Mode { Mode::UltraHighResolution, Mode::HighResolution, Mode::Standard, Mode::UltraLowPower }
 Sensor operation mode for reading the barometric pressure. More...
 

Public Member Functions

 Bmp180 (Mode mode=Mode::Standard)
 Initializes the BMP180 sensor decoder. More...
 
bool isValid () const
 Determines if the last sensor access was valid. More...
 
float temperature () const
 Retrieves the cached temperature value. More...
 
float pressure () const
 Retrieves the cached absolute pressure value. More...
 
float pressureAtSeaLevel (float altitude) const
 Retrieves the cached pressure value relative to sea level. More...
 
bool read ()
 Reads the temperature and pressure from the sensor and updates the cached values. More...
 

Member Enumeration Documentation

◆ Mode

enum Avr::Bmp180::Mode
strong

Sensor operation mode for reading the barometric pressure.

Enumerator
UltraHighResolution 

Configure sensor to take 8 samples when reading barometric pressure. Highest precision, but slow and with high power consumption.

HighResolution 

Configure sensor to take 4 samples when reading barometric pressure.

Standard 

Configure sensor to take 2 samples when reading barometric pressure.

UltraLowPower 

Configure sensor to take 1 sample when reading barometric pressure. Fast and little power consumption, but relatively inaccurate.

Constructor & Destructor Documentation

◆ Bmp180()

Avr::Bmp180::Bmp180 ( Mode  mode = Mode::Standard)
inline

Initializes the BMP180 sensor decoder.

Parameters
modeThe sensor operation mode.

Member Function Documentation

◆ isValid()

bool Avr::Bmp180::isValid ( ) const
inline

Determines if the last sensor access was valid.

Returns
true if the last sensor access was valid and temperature and barometric pressure can be read, false if an error occurred on the last sensor access.

◆ temperature()

float Avr::Bmp180::temperature ( ) const
inline

Retrieves the cached temperature value.

The temperature value is updated by read.

Returns
The cached temperature value.

◆ pressure()

float Avr::Bmp180::pressure ( ) const
inline

Retrieves the cached absolute pressure value.

The barometric pressure value is updated by read.

Returns
The cached absolute pressure value.

◆ pressureAtSeaLevel()

float Avr::Bmp180::pressureAtSeaLevel ( float  altitude) const
inline

Retrieves the cached pressure value relative to sea level.

The barometric pressure value is updated by read.

Parameters
altitudeThe reference altitude.
Returns
The cached pressure value relative to sea level.

◆ read()

bool Avr::Bmp180::read ( )
inline

Reads the temperature and pressure from the sensor and updates the cached values.

Returns
true if the sensor data could be read, false if an error occurred when accessing the sensor.