#include <Adafruit_BMP3XX.h>
Adafruit_BMP3XX Class for both I2C and SPI usage. Wraps the Bosch library for Arduino usage
◆ begin_I2C()
Initializes the sensor.
Hardware ss initialized, verifies it is in the I2C or SPI bus, then reads calibration data in preparation for sensor reads.
- Parameters
-
addr | Optional parameter for the I2C address of BMP3. Default is 0x77 |
theWire | Optional parameter for the I2C device we will use. Default is "Wire" |
- Returns
- True on sensor initialization success. False on failure.
◆ begin_SPI() [1/2]
bool Adafruit_BMP3XX::begin_SPI |
( |
uint8_t |
cs_pin, |
|
|
SPIClass * |
theSPI = &SPI , |
|
|
uint32_t |
frequency = BMP3XX_DEFAULT_SPIFREQ |
|
) |
| |
Sets up the hardware and initializes hardware SPI.
- Parameters
-
cs_pin | The arduino pin # connected to chip select |
theSPI | The SPI object to be used for SPI connections. |
frequency | The SPI bus frequency |
- Returns
- True if initialization was successful, otherwise false.
◆ begin_SPI() [2/2]
bool Adafruit_BMP3XX::begin_SPI |
( |
int8_t |
cs_pin, |
|
|
int8_t |
sck_pin, |
|
|
int8_t |
miso_pin, |
|
|
int8_t |
mosi_pin, |
|
|
uint32_t |
frequency = BMP3XX_DEFAULT_SPIFREQ |
|
) |
| |
Sets up the hardware and initializes software SPI.
- Parameters
-
cs_pin | The arduino pin # connected to chip select |
sck_pin | The arduino pin # connected to SPI clock |
miso_pin | The arduino pin # connected to SPI MISO |
mosi_pin | The arduino pin # connected to SPI MOSI |
frequency | The SPI bus frequency |
- Returns
- True if initialization was successful, otherwise false.
◆ chipID()
uint8_t Adafruit_BMP3XX::chipID |
( |
void |
| ) |
|
Reads the chip identifier.
- Returns
- BMP3_CHIP_ID or BMP390_CHIP_ID
◆ readTemperature()
float Adafruit_BMP3XX::readTemperature |
( |
void |
| ) |
|
Performs a reading and returns the ambient temperature.
- Returns
- Temperature in degrees Centigrade
◆ readPressure()
float Adafruit_BMP3XX::readPressure |
( |
void |
| ) |
|
Performs a reading and returns the barometric pressure.
- Returns
- Barometic pressure in Pascals
◆ readAltitude()
float Adafruit_BMP3XX::readAltitude |
( |
float |
seaLevel | ) |
|
Calculates the altitude (in meters).
Reads the current atmostpheric pressure (in hPa) from the sensor and calculates via the provided sea-level pressure (in hPa).
- Parameters
-
seaLevel | Sea-level pressure in hPa |
- Returns
- Altitude in meters
◆ setTemperatureOversampling()
bool Adafruit_BMP3XX::setTemperatureOversampling |
( |
uint8_t |
oversample | ) |
|
Setter for Temperature oversampling.
- Parameters
-
oversample | Oversampling setting, can be BMP3_NO_OVERSAMPLING, BMP3_OVERSAMPLING_2X, BMP3_OVERSAMPLING_4X, BMP3_OVERSAMPLING_8X, BMP3_OVERSAMPLING_16X, BMP3_OVERSAMPLING_32X |
- Returns
- True on success, False on failure
◆ setPressureOversampling()
bool Adafruit_BMP3XX::setPressureOversampling |
( |
uint8_t |
oversample | ) |
|
Setter for Pressure oversampling.
- Parameters
-
oversample | Oversampling setting, can be BMP3_NO_OVERSAMPLING, BMP3_OVERSAMPLING_2X, BMP3_OVERSAMPLING_4X, BMP3_OVERSAMPLING_8X, BMP3_OVERSAMPLING_16X, BMP3_OVERSAMPLING_32X |
- Returns
- True on success, False on failure
◆ setIIRFilterCoeff()
bool Adafruit_BMP3XX::setIIRFilterCoeff |
( |
uint8_t |
filtercoeff | ) |
|
Setter for IIR filter coefficient.
- Parameters
-
filtercoeff | Coefficient of the filter (in samples). Can be BMP3_IIR_FILTER_DISABLE (no filtering), BMP3_IIR_FILTER_COEFF_1, BMP3_IIR_FILTER_COEFF_3, BMP3_IIR_FILTER_COEFF_7, BMP3_IIR_FILTER_COEFF_15, BMP3_IIR_FILTER_COEFF_31, BMP3_IIR_FILTER_COEFF_63, BMP3_IIR_FILTER_COEFF_127 |
- Returns
- True on success, False on failure
◆ setOutputDataRate()
bool Adafruit_BMP3XX::setOutputDataRate |
( |
uint8_t |
odr | ) |
|
Setter for output data rate (ODR)
- Parameters
-
odr | Sample rate in Hz. Can be BMP3_ODR_200_HZ, BMP3_ODR_100_HZ, BMP3_ODR_50_HZ, BMP3_ODR_25_HZ, BMP3_ODR_12_5_HZ, BMP3_ODR_6_25_HZ, BMP3_ODR_3_1_HZ, BMP3_ODR_1_5_HZ, BMP3_ODR_0_78_HZ, BMP3_ODR_0_39_HZ, BMP3_ODR_0_2_HZ, BMP3_ODR_0_1_HZ, BMP3_ODR_0_05_HZ, BMP3_ODR_0_02_HZ, BMP3_ODR_0_01_HZ, BMP3_ODR_0_006_HZ, BMP3_ODR_0_003_HZ, or BMP3_ODR_0_001_HZ |
- Returns
- True on success, False on failure
◆ performReading()
bool Adafruit_BMP3XX::performReading |
( |
void |
| ) |
|
The documentation for this class was generated from the following files: