Skip to content

setGas()

Arnd edited this page May 16, 2020 · 2 revisions

[success=] setGas(Temperature , Duration);


This sets the heating target temperature in degrees Celsius and heating duration in milliseconds for the gas sensor. Setting either parameter to 0 will turn off the gas sensor. The function always returns "true".


Example:

...    
...    
BME680_Class BME680;  // Instantiate class    
...    
...    
while (!BME680.begin()) {                          // 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
bool unused = BME680.setGas(320,150);              // Set to heat to 320C for 150ms
...    
...