Skip to main content

Bme680 - Initializing

Connections for this example

Connections

Initialization

To use the BME680 sensor, first include the required library, create the sensor object, and initialize the sensor in the setup() function.

//Include the library
#include <BME680-SOLDERED.h>

//Create an instance of the sensor
BME680 bme680;

void setup() {
Serial.begin(9600);
//Initialize an I2C connection with the sensor
if (!bme680.begin())
{
Serial.println("Failed to initialize sensor! Check connection.");
}
}
//...

bme680.begin()

Initializes the BME680 sensor, setting up communication over I2C and configuring oversampling values for each sensor

Returns value: Boolean value. True if the sensor was successfully initialized, False otherwise