#include <Adafruit_BME680.h>
Adafruit_BME680 Class for both I2C and SPI usage. Wraps the Bosch library for Arduino usage
◆ Adafruit_BME680() [1/2]
Adafruit_BME680::Adafruit_BME680 |
( |
int8_t |
cspin = -1 | ) |
|
Instantiates sensor with Hardware SPI or I2C.
- Parameters
-
cspin | SPI chip select. If not passed in, I2C will be used |
◆ Adafruit_BME680() [2/2]
Adafruit_BME680::Adafruit_BME680 |
( |
int8_t |
cspin, |
|
|
int8_t |
mosipin, |
|
|
int8_t |
misopin, |
|
|
int8_t |
sckpin |
|
) |
| |
Instantiates sensor with Software (bit-bang) SPI.
- Parameters
-
cspin | SPI chip select |
mosipin | SPI MOSI (Data from microcontroller to sensor) |
misopin | SPI MISO (Data to microcontroller from sensor) |
sckpin | SPI Clock |
◆ begin()
bool Adafruit_BME680::begin |
( |
uint8_t |
addr = BME680_DEFAULT_ADDRESS | ) |
|
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 BME680. Default is 0x77 |
- Returns
- True on sensor initialization success. False on failure.
◆ performReading()
bool Adafruit_BME680::performReading |
( |
void |
| ) |
|
◆ readAltitude()
float Adafruit_BME680::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
◆ readGas()
uint32_t Adafruit_BME680::readGas |
( |
void |
| ) |
|
Calculates the resistance of the MOX gas sensor.
- Returns
- Resistance in Ohms
◆ readHumidity()
float Adafruit_BME680::readHumidity |
( |
void |
| ) |
|
Performs a reading and returns the relative humidity.
- Returns
- Relative humidity as floating point
◆ readPressure()
float Adafruit_BME680::readPressure |
( |
void |
| ) |
|
Performs a reading and returns the barometric pressure.
- Returns
- Barometic pressure in Pascals
◆ readTemperature()
float Adafruit_BME680::readTemperature |
( |
void |
| ) |
|
Performs a reading and returns the ambient temperature.
- Returns
- Temperature in degrees Centigrade
◆ setGasHeater()
bool Adafruit_BME680::setGasHeater |
( |
uint16_t |
heaterTemp, |
|
|
uint16_t |
heaterTime |
|
) |
| |
Enable and configure gas reading + heater.
- Parameters
-
heaterTemp | Desired temperature in degrees Centigrade |
heaterTime | Time to keep heater on in milliseconds |
- Returns
- True on success, False on failure
◆ setHumidityOversampling()
bool Adafruit_BME680::setHumidityOversampling |
( |
uint8_t |
oversample | ) |
|
Setter for Humidity oversampling.
- Parameters
-
oversample | Oversampling setting, can be BME680_OS_NONE (turn off Humidity reading), BME680_OS_1X, BME680_OS_2X, BME680_OS_4X, BME680_OS_8X or BME680_OS_16X |
- Returns
- True on success, False on failure
◆ setIIRFilterSize()
bool Adafruit_BME680::setIIRFilterSize |
( |
uint8_t |
filtersize | ) |
|
Setter for IIR filter.
- Parameters
-
filtersize | Size of the filter (in samples). Can be BME680_FILTER_SIZE_0 (no filtering), BME680_FILTER_SIZE_1, BME680_FILTER_SIZE_3, BME680_FILTER_SIZE_7, BME680_FILTER_SIZE_15, BME680_FILTER_SIZE_31, BME680_FILTER_SIZE_63, BME680_FILTER_SIZE_127 |
- Returns
- True on success, False on failure
◆ setPressureOversampling()
bool Adafruit_BME680::setPressureOversampling |
( |
uint8_t |
os | ) |
|
Setter for Pressure oversampling.
- Parameters
-
oversample | Oversampling setting, can be BME680_OS_NONE (turn off Pressure reading), BME680_OS_1X, BME680_OS_2X, BME680_OS_4X, BME680_OS_8X or BME680_OS_16X |
- Returns
- True on success, False on failure
◆ setTemperatureOversampling()
bool Adafruit_BME680::setTemperatureOversampling |
( |
uint8_t |
oversample | ) |
|
Setter for Temperature oversampling.
- Parameters
-
oversample | Oversampling setting, can be BME680_OS_NONE (turn off Temperature reading), BME680_OS_1X, BME680_OS_2X, BME680_OS_4X, BME680_OS_8X or BME680_OS_16X |
- Returns
- True on success, False on failure
The documentation for this class was generated from the following files: