diff --git a/main/ZsensorBME280.ino b/main/ZsensorBME280.ino index e037d47ba5..8cbe67219c 100644 --- a/main/ZsensorBME280.ino +++ b/main/ZsensorBME280.ino @@ -107,6 +107,12 @@ void setupZsensorBME280() { // 1 through 5, oversampling *1, *2, *4, *8, *16 respectively mySensor.settings.humidOverSample = 1; + // tempCorrection - Correction in celcius of temperature reported by bme280 sensor. Both Celcius and Farenheit temperatures are adjusted. + // ------------------------- + // Value is a float + // ie Compiler Directive '-DBME280Correction=-3.4' + mySensor.settings.tempCorrection = BME280Correction; + delay(10); // Gives the Sensor enough time to turn on (The BME280 requires 2ms to start up) int ret = mySensor.begin(); diff --git a/main/config_BME280.h b/main/config_BME280.h index a38e5510b3..ebddc1bf00 100644 --- a/main/config_BME280.h +++ b/main/config_BME280.h @@ -62,4 +62,16 @@ int BME280_i2c_addr = 0x76; // Bosch BME280 I2C Address int BME280_PIN_SDA = SDA; // PIN SDA int BME280_PIN_SCL = SCL; // PIN SCL +// Temperature correction for BME280 devices + +#ifndef BME280Correction + +// BME280Correction - Correction in celcius of temperature reported by bme280 sensor. Both Celcius and Farenheit temperatures are adjusted. +// ------------------------- +// Value is a float +// ie Compiler Directive '-DBME280Correction=-3.4' + +# define BME280Correction 0 +#endif + #endif diff --git a/platformio.ini b/platformio.ini index a0020769b3..173d606ac5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -236,6 +236,7 @@ build_flags = '-DZsensorADC="ADC"' '-DZsensorBH1750="BH1750"' '-DZsensorBME280="BME280"' + '-DBME280Correction=-3.4' '-DZsensorHTU21="HTU21"' '-DZsensorAHTx0="AHTx0"' '-DZsensorTSL2561="TSL2561"'