-
Notifications
You must be signed in to change notification settings - Fork 13
begin()
[success=] begin([I2CSpeed]); // for I2C
[success=] begin(SS); // SS (Slave Select) Pin for HW SPI
[success=] begin(SS,MISO,MOSI,SCK); // SW SPI
This function initializes the BME680 device using one of the 3 available protocols:
-
I2C
By default the I2C address of the BME680 is hard-wired to 0x76 or 0x77 although the address might something completely different when using an I2C expander. The library will search all possible I2C addresses until it finds the first BME680 and will use that device. -
Hardware SPI
When called with just one parameter it will use hardware SPI and the pin parameter passed in is the SS pin, or "Slave Select" pin. This parameter must be an unsigned small integer. -
Software SPI
When called with 4 parameters then software SPI is used and the 4 pins are assigned accordingly.
The function has an optional return value which is TRUE when the device has been located and initialized, otherwise a FALSE will be returned.
The I2C bus defaults to the slowest speed, 100KHz. The Bosch sensor can go much faster if desired, specify one of the following Constants in the optional I2CSpeed parameter.
Constant | Speed |
---|---|
I2C_STANDARD_MODE | 100KHz |
I2C_FAST_MODE | 400KHz |
I2C_FAST_MODE_PLUS | 1MHz |
I2C_HIGH_SPEED_MODE | 3.4MHz |
BME280_Class BME680; // Instantiate class
...
while (!BME680.begin(I2C_FAST_MODE_PLUS)) { // Find on I2C bus
Serial.println("Error, unable to find BME680."); // Show error message
delay(5000); // Wait 5 seconds
} // of if-then we can't initialize or find the device
Overview
Installation
Class Instantiation
begin()
setOversampling()
setIIRFilter()
setGas()
getSensorData()
getI2CAddress()
waitForReadings()
measuring()
triggerMeasurement()
reset()
-none-
Modes
Sensors
Oversampling
IIR Filters
I2CDemo.ino
SPIDemo.ino
SoftSPIDemo.ino
TwoDevicesI2CDemo.ino
SDLoggerSPIDemo.ino
ESP32FeatherWiFiDemo.ino