Avr::Bmp180 decodes data from Bosch BMP180 Digital pressure sensors.
More...
Avr::Bmp180 decodes data from Bosch BMP180 Digital pressure sensors.
◆ Avr::Bmp180
◆ Mode
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.
|
◆ Bmp180()
Initializes the BMP180 sensor decoder.
- Parameters
-
| mode | The sensor operation mode. |
◆ 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
-
| altitude | The 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.