Skip to content

Class Instantiation

Arnd edited this page Dec 12, 2020 · 4 revisions

BME680();

The BME680 class instantiation has no parameters required for instantiation. The device itself isn't initialized until the begin() method is called. Once either SPI or I2C communications are started the BME680 will ignore the other protocol and the device needs to be reset in order to change the communication protocol.


Example:

...    
...    
BME680 Sensor();  // Instantiate class    
...    
...    
/* Sensor.begin() starts with I2C and searches for a the BME680 at either 0x76 or 0x77 */
while (!Sensor.begin()) // Loop until sensor found
{                                      
  Serial.println("Error, unable to find or identify BME680."); // Show error message
  delay(5000);                                                 // Wait 5 seconds before retrying
} // of if-then we can't initialize or find the device
...    
...