ExoBme680 - nemax68/test GitHub Wiki

This library provides functions to control Exo Sense BME680 environment data sensor.

Import the library in your sketch:

#include <ExoBme680.h>

The library inlude the BME680 API that implement initialization and calibration procedure and ambient data acquisition from the BME680 sensor.

Following are the available methods:

begin

begin(void)

This method must be called from the setup, it initialize and calibrate the BME680 sensor and set default oversampling values.

readTemperature

readTemperature(void)

This method return last temerature read in Celsius.

readPressure

readPressure(void)

This method return last pressure read in Pascal.

readHumidity

readHumidity(void)

This method return last humidity read in %.

readGas

readGas(void)

This method return last gas resistance read in ohms.

readAltitude

readAltitude(void)

This method return last altitude read in mt.

running

running(void)

This method return TRUE if a measure is running FALSE otherwise.

done

done(void)

This method return TRUE if a measure is ready FALSE otherwise.

start

start(void)

This method start a new measure if BME680 was correctly initialized and no measure is running.

read

read(void)

This method acquire a new set of measures when done.

setOversampling

setOversampling(uint8_t meas, uint8_t oversample)

This method can be used to define an oversample value (BME680_OS_1X, BME680_OS_2X, BME680_OS_4X, BME680_OS_8X, BME680_OS_16X or BME680_OS_NONE to turn off the measure) for a specific measure (TEMPERATURE,HUMIDITY and PRESSURE).

setIIRFilterSize

setIIRFilterSize(uint8_t filtersize)

This method can be used to define the filter size (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 or BME680_FILTER_SIZE_0 to turn off filtering).

setGasHeater

setGasHeater(uint16_t heaterTemp, uint16_t heaterTime)

This method can be used to define the desired heat temperature (heaterTemp) in degrees Centigrade to keep for a defined time (heaterTime) in millisec in order to mesure the gas resistance.

Examples

The library folder includes some examples that can be opened directly from the Arduino IDE menu File > Examples > ExoBmp680.

  • Bmp680 shows how to get BMP680 value with the polling method