BME680  v1.0.12
Arduino Library for Bosch BME680 Temperature, Humidity, and Pressure
BME680_Class Class Reference

Main BME680 class for the temperature / humidity / pressure sensor. More...

Public Member Functions

 BME680_Class ()
 
 ~BME680_Class ()
 
bool begin ()
 
bool begin (const uint32_t i2cSpeed)
 
bool begin (const uint8_t chipSelect)
 
bool begin (const uint32_t i2cSpeed, const uint8_t i2cAddress)
 
bool begin (const uint8_t chipSelect, const uint8_t mosi, const uint8_t miso, const uint8_t sck)
 
uint8_t setOversampling (const uint8_t sensor, const uint8_t sampling=UINT8_MAX) const
 
bool setGas (uint16_t GasTemp, uint16_t GasMillis) const
 
uint8_t setIIRFilter (const uint8_t iirFilterSetting=UINT8_MAX) const
 
uint8_t getSensorData (int32_t &temp, int32_t &hum, int32_t &press, int32_t &gas, const bool waitSwitch=true)
 
uint8_t getI2CAddress () const
 
void reset ()
 
bool measuring () const
 true if currently measuring More...
 
void triggerMeasurement () const
 trigger a measurement More...
 

Detailed Description

Main BME680 class for the temperature / humidity / pressure sensor.

Constructor & Destructor Documentation

◆ BME680_Class()

BME680_Class::BME680_Class ( )

Class constructor

Currently empty and unused

◆ ~BME680_Class()

BME680_Class::~BME680_Class ( )

Class destructor

Currently empty and unused

Member Function Documentation

◆ begin() [1/5]

bool BME680_Class::begin ( )

starts communications with device (overloaded)

When called with no parameters the I2C protocol with I2C_STANDARD_MODE speed is selected. The I2C network is searched for the first BME680 device. return "true" if successful otherwise false

◆ begin() [2/5]

bool BME680_Class::begin ( const uint32_t  i2cSpeed)

starts communications with device (overloaded)

When called with a 32-bit parameter it is assumed that the I2C protocol is to be used and the speed setting is determined by the parameter.

Parameters
[in]i2cSpeedI2C Speed value return "true" if successful otherwise false

◆ begin() [3/5]

bool BME680_Class::begin ( const uint8_t  chipSelect)

starts communications with device (overloaded)

When called with a single 8-bit parameter is assumed that hardware SPI is to be used if the value is not 0x76 or 0x77, in which case it is assumed that it is the I2C addr

Parameters
[in]chipSelectArduino Pin number for the Slave-Select pin or the I2C address return "true" if successful otherwise false

◆ begin() [4/5]

bool BME680_Class::begin ( const uint32_t  i2cSpeed,
const uint8_t  i2cAddress 
)

starts communications with device (overloaded)

When called with a 32-bit parameter it is assumed that the I2C protocol is to be used and the speed setting is determined by the parameter. If the i2cAddress is 0 then check both, otherwise check only only the specified address

Parameters
[in]i2cSpeedI2C Speed value
[in]i2cAddressI2C Address, use 0 to self-determine return "true" if successful otherwise false

◆ begin() [5/5]

bool BME680_Class::begin ( const uint8_t  chipSelect,
const uint8_t  mosi,
const uint8_t  miso,
const uint8_t  sck 
)

starts communications with device (overloaded)

When called with 4 parameters then software SPI is assumed

Parameters
[in]chipSelectArduino Pin number for the Slave-Select pin
[in]mosiArduino Pin number for the Master-out-Slave-in pin
[in]misoArduino Pin number for the Master-in-Slave-out pin
[in]sckArduino Pin number for the System clock pin return "true" if successful otherwise false

◆ getI2CAddress()

uint8_t BME680_Class::getI2CAddress ( ) const

Returns the I2C address of the BME680 return I2C Address from private variables

◆ getSensorData()

uint8_t BME680_Class::getSensorData ( int32_t &  temp,
int32_t &  hum,
int32_t &  press,
int32_t &  gas,
const bool  waitSwitch = true 
)

Returns the most recent temperature, humidity and pressure readings param[out] temp Temperature reading param[out] hum Humidity reading param[out] press Pressure reading param[out] gas Gas reading param[in] waitSwitch (Optional) When set will not return until reading is finished

◆ measuring()

bool BME680_Class::measuring ( ) const

true if currently measuring

Returns whether the BME680 is currently measuring return "true" if a measurement is active, otherwise "false"

◆ reset()

void BME680_Class::reset ( )

Performs a device reset

◆ setGas()

bool BME680_Class::setGas ( uint16_t  GasTemp,
uint16_t  GasMillis 
) const

sets the gas measurement target temperature and heating time param[in] GasTemp Target temperature in Celsius param[in] GasMillis Milliseconds to turn on heater return Always returns "true"

◆ setIIRFilter()

uint8_t BME680_Class::setIIRFilter ( const uint8_t  iirFilterSetting = UINT8_MAX) const

Set or return the current IIR filter setting

When called with no parameters returns the current IIR Filter setting, otherwise when called with one parameter will set the IIR filter value and return the new setting param[in] iirFilterSetting New setting return IIR Filter setting

◆ setOversampling()

uint8_t BME680_Class::setOversampling ( const uint8_t  sensor,
const uint8_t  sampling = UINT8_MAX 
) const

sets the oversampling mode for the sensor

See enumerated "sensorTypes" for a list of values. Set to a valid oversampling rate as defined in the enumerated type oversamplingTypes. If either value is out of range or another error occurs then the return value is false. param[in] sensor Enumerated sensor type param[in] sampling Sampling rate from enumerated type return "true" if successful otherwise false

◆ triggerMeasurement()

void BME680_Class::triggerMeasurement ( ) const

trigger a measurement

Trigger a new measurement on the BME680


The documentation for this class was generated from the following files: