From 8ac11624055838c550fd8c3e19d06aa62d63187a Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Sun, 4 Nov 2018 09:06:36 -0700 Subject: [PATCH 01/25] Adding temp correction from @cz6ace --- src/SparkFunBME280.cpp | 3 ++- src/SparkFunBME280.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SparkFunBME280.cpp b/src/SparkFunBME280.cpp index 0f049de..d64b52c 100644 --- a/src/SparkFunBME280.cpp +++ b/src/SparkFunBME280.cpp @@ -47,6 +47,7 @@ BME280::BME280( void ) settings.tempOverSample = 1; settings.pressOverSample = 1; settings.humidOverSample = 1; + settings.tempCorrection = 0.0; // correction of temperature - added to the result } @@ -482,7 +483,7 @@ float BME280::readTempC( void ) t_fine = var1 + var2; float output = (t_fine * 5 + 128) >> 8; - output = output / 100; + output = output / 100 + settings.tempCorrection; return output; } diff --git a/src/SparkFunBME280.h b/src/SparkFunBME280.h index b5619bd..9c348dd 100644 --- a/src/SparkFunBME280.h +++ b/src/SparkFunBME280.h @@ -128,6 +128,7 @@ struct SensorSettings uint8_t tempOverSample; uint8_t pressOverSample; uint8_t humidOverSample; + float tempCorrection; // correction of temperature - added to the result }; //Used to hold the calibration constants. These are used From f9038f319a560265cfde6e3d3f46f4e8827cee6f Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Sun, 4 Nov 2018 09:06:55 -0700 Subject: [PATCH 02/25] Lib ver roll --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index bdab400..a611c48 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SparkFun BME280 -version=2.0.2 +version=2.0.3 author=SparkFun Electronics maintainer=SparkFun Electronics sentence=A library to drive the Bosch BME280 Altimeter and Pressure sensor From 035bdd9755d4044a7fe2e731dda314327b779af3 Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Mon, 10 Dec 2018 14:51:55 -0700 Subject: [PATCH 03/25] Correcting coefficient in alt calculation. Fixes issue #30 --- src/SparkFunBME280.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SparkFunBME280.cpp b/src/SparkFunBME280.cpp index d64b52c..b3d43b9 100644 --- a/src/SparkFunBME280.cpp +++ b/src/SparkFunBME280.cpp @@ -418,7 +418,8 @@ float BME280::readFloatAltitudeMeters( void ) { float heightOutput = 0; - heightOutput = ((float)-45846.2)*(pow(((float)readFloatPressure()/(float)_referencePressure), 0.190263) - (float)1); + //heightOutput = ((float)-45846.2)*(pow(((float)readFloatPressure()/(float)_referencePressure), 0.190263) - (float)1); + heightOutput = ((float)-44330.77)*(pow(((float)readFloatPressure()/(float)_referencePressure), 0.190263) - (float)1); //Corrected, see issue 30 return heightOutput; } From 41f303357089f5eabf3ddf935b6d4378b9ac8228 Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Mon, 10 Dec 2018 14:52:20 -0700 Subject: [PATCH 04/25] Lib ver roll --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index a611c48..b4a6164 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SparkFun BME280 -version=2.0.3 +version=2.0.4 author=SparkFun Electronics maintainer=SparkFun Electronics sentence=A library to drive the Bosch BME280 Altimeter and Pressure sensor From 4e920f9250fde3244e5eb20bbd2e3fcb4a6f6784 Mon Sep 17 00:00:00 2001 From: Calvin Young Date: Fri, 4 Oct 2019 17:01:35 -0400 Subject: [PATCH 05/25] Changed variable name struct SensorSettings -> BME280_SensorSettings --- src/SparkFunBME280.cpp | 2 +- src/SparkFunBME280.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/SparkFunBME280.cpp b/src/SparkFunBME280.cpp index b3d43b9..83cb0ac 100644 --- a/src/SparkFunBME280.cpp +++ b/src/SparkFunBME280.cpp @@ -55,7 +55,7 @@ BME280::BME280( void ) // // Configuration section // -// This uses the stored SensorSettings to start the IMU +// This uses the stored BME280_SensorSettings to start the IMU // Use statements such as "mySensor.settings.commInterface = SPI_MODE;" to // configure before calling .begin(); // diff --git a/src/SparkFunBME280.h b/src/SparkFunBME280.h index 9c348dd..7e3693e 100644 --- a/src/SparkFunBME280.h +++ b/src/SparkFunBME280.h @@ -102,17 +102,17 @@ Distributed as-is; no warranty is given. #define BME280_HUMIDITY_MSB_REG 0xFD //Humidity MSB #define BME280_HUMIDITY_LSB_REG 0xFE //Humidity LSB -//Class SensorSettings. This object is used to hold settings data. The application +//Class BME280_SensorSettings. This object is used to hold settings data. The application //uses this classes' data directly. The settings are adopted and sent to the sensor //at special times, such as .begin. Some are used for doing math. // //This is a kind of bloated way to do this. The trade-off is that the user doesn't //need to deal with #defines or enums with bizarre names. // -//A power user would strip out SensorSettings entirely, and send specific read and +//A power user would strip out BME280_SensorSettings entirely, and send specific read and //write command directly to the IC. (ST #defines below) // -struct SensorSettings +struct BME280_SensorSettings { public: @@ -165,16 +165,16 @@ class BME280 { public: //settings - SensorSettings settings; + BME280_SensorSettings settings; SensorCalibration calibration; int32_t t_fine; - //Constructor generates default SensorSettings. + //Constructor generates default BME280_SensorSettings. //(over-ride after construction if desired) BME280( void ); //~BME280() = default; - //Call to apply SensorSettings. + //Call to apply BME280_SensorSettings. //This also gets the SensorCalibration constants uint8_t begin( void ); bool beginSPI(uint8_t csPin); //Communicate using SPI From d34baef4bf10ccabf46f7fb0debaaf0d7cd845c3 Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Mon, 7 Oct 2019 16:01:21 -0600 Subject: [PATCH 06/25] Add thanks to readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 2c82005..abb6523 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,10 @@ It also provides the following mathematical functions based from the above. Some examples include a circular buffer class for averaging. +Thanks to: +* calvin1564 for [fixing a name collision](https://github.com/sparkfun/SparkFun_BME280_Arduino_Library/pull/34) +* LukaHitH for adding [BMP280 support](https://github.com/sparkfun/SparkFun_BME280_Arduino_Library/pull/23) + Repository Contents ------------------- From 8c89f95219bf74f2b9717f9e64e67fb6cc512f38 Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Mon, 7 Oct 2019 16:15:19 -0600 Subject: [PATCH 07/25] Update library.properties for release 2.0.5. --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index b4a6164..ffe8cb2 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SparkFun BME280 -version=2.0.4 +version=2.0.5 author=SparkFun Electronics maintainer=SparkFun Electronics sentence=A library to drive the Bosch BME280 Altimeter and Pressure sensor From a7469f00ecbd9967f352ab1625db2f5eabdaf6cf Mon Sep 17 00:00:00 2001 From: fabyte Date: Sat, 19 Oct 2019 14:01:45 +0200 Subject: [PATCH 08/25] Improve SPI communication using SPISettings Using SPISettings together with begin/endTransaction allows using multiple systems communicating over the same SPI bus. Thus far, the initial SPI configuration was overridden by other systems that configured SPI. Additionally, due to compiler and linker optimizations, adjusting the SPI settings via BME280_SPI_CLOCK, a much smaller memory footprint is possible. Finally, allow modification of the SPI mode by defining BME280_SPI_MODE. --- src/SparkFunBME280.cpp | 31 +++++-------------------------- src/SparkFunBME280.h | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/src/SparkFunBME280.cpp b/src/SparkFunBME280.cpp index 83cb0ac..9be4d95 100644 --- a/src/SparkFunBME280.cpp +++ b/src/SparkFunBME280.cpp @@ -86,24 +86,6 @@ uint8_t BME280::begin() case SPI_MODE: // start the SPI library: SPI.begin(); - #ifdef ARDUINO_ARCH_ESP32 - SPI.setFrequency(1000000); - // Data is read and written MSb first. - SPI.setBitOrder(SPI_MSBFIRST); - // Like the standard arduino/teensy comment below, mode0 seems wrong according to standards - // but conforms to the timing diagrams when used for the ESP32 - SPI.setDataMode(SPI_MODE0); - #else - // Maximum SPI frequency is 10MHz, could divide by 2 here: - SPI.setClockDivider(SPI_CLOCK_DIV32); - // Data is read and written MSb first. - SPI.setBitOrder(MSBFIRST); - // Data is captured on rising edge of clock (CPHA = 0) - // Base value of the clock is HIGH (CPOL = 1) - // This was SPI_MODE3 for RedBoard, but I had to change to - // MODE0 for Teensy 3.1 operation - SPI.setDataMode(SPI_MODE3); - #endif // initialize the data ready and chip select pins: pinMode(settings.chipSelectPin, OUTPUT); digitalWrite(settings.chipSelectPin, HIGH); @@ -580,6 +562,7 @@ void BME280::readRegisterRegion(uint8_t *outputPointer , uint8_t offset, uint8_t break; case SPI_MODE: + SPI.beginTransaction(settings.spiSettings); // take the chip select low to select the device: digitalWrite(settings.chipSelectPin, LOW); // send the device the register you want to read: @@ -593,6 +576,7 @@ void BME280::readRegisterRegion(uint8_t *outputPointer , uint8_t offset, uint8_t } // take the chip select high to de-select: digitalWrite(settings.chipSelectPin, HIGH); + SPI.endTransaction(); break; default: @@ -641,14 +625,7 @@ uint8_t BME280::readRegister(uint8_t offset) break; case SPI_MODE: - // take the chip select low to select the device: - digitalWrite(settings.chipSelectPin, LOW); - // send the device the register you want to read: - SPI.transfer(offset | 0x80); //Ored with "read request" bit - // send a value of 0 to read the first byte returned: - result = SPI.transfer(0x00); - // take the chip select high to de-select: - digitalWrite(settings.chipSelectPin, HIGH); + readRegisterRegion(&result, offset, 1); break; default: @@ -693,6 +670,7 @@ void BME280::writeRegister(uint8_t offset, uint8_t dataToWrite) break; case SPI_MODE: + SPI.beginTransaction(settings.spiSettings); // take the chip select low to select the device: digitalWrite(settings.chipSelectPin, LOW); // send the device the register you want to read: @@ -702,6 +680,7 @@ void BME280::writeRegister(uint8_t offset, uint8_t dataToWrite) // decrement the number of bytes left to read: // take the chip select high to de-select: digitalWrite(settings.chipSelectPin, HIGH); + SPI.endTransaction(); break; default: diff --git a/src/SparkFunBME280.h b/src/SparkFunBME280.h index 7e3693e..0b7b766 100644 --- a/src/SparkFunBME280.h +++ b/src/SparkFunBME280.h @@ -46,6 +46,18 @@ Distributed as-is; no warranty is given. #define I2C_MODE 0 #define SPI_MODE 1 +#ifndef BME280_SPI_CLOCK +#ifdef ARDUINO_ARCH_ESP32 +#define BME280_SPI_CLOCK 1000000 +#else +#define BME280_SPI_CLOCK 500000 +#endif +#endif + +#ifndef BME280_SPI_MODE +#define BME280_SPI_MODE SPI_MODE0 +#endif + #define NO_WIRE 0 #define HARD_WIRE 1 #define SOFT_WIRE 2 @@ -120,7 +132,8 @@ struct BME280_SensorSettings uint8_t commInterface; uint8_t I2CAddress; uint8_t chipSelectPin; - + SPISettings spiSettings{BME280_SPI_CLOCK, MSBFIRST, BME280_SPI_MODE}; + //Deprecated settings uint8_t runMode; uint8_t tStandby; From 288ca803611059353d8d97e05c7c00163e3072df Mon Sep 17 00:00:00 2001 From: Phil Bolduc Date: Sun, 20 Oct 2019 13:57:14 -0700 Subject: [PATCH 09/25] Avoid calling begin more than is required #36 --- src/SparkFunBME280.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/SparkFunBME280.cpp b/src/SparkFunBME280.cpp index 83cb0ac..77272bc 100644 --- a/src/SparkFunBME280.cpp +++ b/src/SparkFunBME280.cpp @@ -159,8 +159,10 @@ bool BME280::beginSPI(uint8_t csPin) settings.chipSelectPin = csPin; settings.commInterface = SPI_MODE; - if(begin() == 0x58) return(true); //Begin normal init with these settings. Should return chip ID of 0x58 for BMP - if(begin() == 0x60) return(true); //Begin normal init with these settings. Should return chip ID of 0x60 for BME + uint8_t chipID = begin(); + + if(chipID == 0x58) return(true); //Begin normal init with these settings. Should return chip ID of 0x58 for BMP + if(chipID == 0x60) return(true); //Begin normal init with these settings. Should return chip ID of 0x60 for BME return(false); } @@ -171,10 +173,12 @@ bool BME280::beginI2C(TwoWire &wirePort) _wireType = HARD_WIRE; settings.commInterface = I2C_MODE; - //settings.I2CAddress = 0x77; //We assume user has set the I2C address using setI2CAddress() - if(begin() == 0x58) return(true); //Begin normal init with these settings. Should return chip ID of 0x58 for BMP - if(begin() == 0x60) return(true); //Begin normal init with these settings. Should return chip ID of 0x60 for BME + + uint8_t chipID = begin(); + + if(chipID == 0x58) return(true); //Begin normal init with these settings. Should return chip ID of 0x58 for BMP + if(chipID == 0x60) return(true); //Begin normal init with these settings. Should return chip ID of 0x60 for BME return(false); } @@ -188,8 +192,10 @@ bool BME280::beginI2C(SoftwareWire& wirePort) settings.commInterface = I2C_MODE; //settings.I2CAddress = 0x77; //We assume user has set the I2C address using setI2CAddress() - if(begin() == 0x58) return(true); //Begin normal init with these settings. Should return chip ID of 0x58 for BMP - if(begin() == 0x60) return(true); //Begin normal init with these settings. Should return chip ID of 0x60 for BME + uint8_t chipID = begin(); + + if(chipID == 0x58) return(true); //Begin normal init with these settings. Should return chip ID of 0x58 for BMP + if(chipID == 0x60) return(true); //Begin normal init with these settings. Should return chip ID of 0x60 for BME return(false); } #endif From 7a7fb985268b7c8ca7678b1658b33d5ce541b980 Mon Sep 17 00:00:00 2001 From: AndyEngland521 Date: Wed, 30 Oct 2019 12:01:28 -0600 Subject: [PATCH 10/25] bumping to v2.0.6, not calling begin multiple times to get chip ID --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index ffe8cb2..a91aa42 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SparkFun BME280 -version=2.0.5 +version=2.0.6 author=SparkFun Electronics maintainer=SparkFun Electronics sentence=A library to drive the Bosch BME280 Altimeter and Pressure sensor From 87fea48a834671008244d51d42d3830e45d6d09e Mon Sep 17 00:00:00 2001 From: Andrew England Date: Mon, 18 Nov 2019 12:14:00 -0700 Subject: [PATCH 11/25] updating SPISettings config --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index a91aa42..7fd0ba7 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SparkFun BME280 -version=2.0.6 +version=2.0.7 author=SparkFun Electronics maintainer=SparkFun Electronics sentence=A library to drive the Bosch BME280 Altimeter and Pressure sensor From 62d8a50a53b6d2f7334eb923e1ffb746847618aa Mon Sep 17 00:00:00 2001 From: Christian Stehno Date: Tue, 26 Nov 2019 17:26:16 +0100 Subject: [PATCH 12/25] Add method for setting temperature correction --- src/SparkFunBME280.cpp | 7 ++++++- src/SparkFunBME280.h | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/SparkFunBME280.cpp b/src/SparkFunBME280.cpp index c312244..31d5377 100644 --- a/src/SparkFunBME280.cpp +++ b/src/SparkFunBME280.cpp @@ -47,7 +47,7 @@ BME280::BME280( void ) settings.tempOverSample = 1; settings.pressOverSample = 1; settings.humidOverSample = 1; - settings.tempCorrection = 0.0; // correction of temperature - added to the result + settings.tempCorrection = 0.f; // correction of temperature - added to the result } @@ -453,6 +453,11 @@ float BME280::readFloatHumidity( void ) // //****************************************************************************// +void BME280::setTemperatureCorrection(float corr) +{ + settings.tempCorrection = corr; +} + float BME280::readTempC( void ) { // Returns temperature in DegC, resolution is 0.01 DegC. Output value of “5123” equals 51.23 DegC. diff --git a/src/SparkFunBME280.h b/src/SparkFunBME280.h index 0b7b766..77667b3 100644 --- a/src/SparkFunBME280.h +++ b/src/SparkFunBME280.h @@ -223,7 +223,8 @@ class BME280 float readFloatHumidity( void ); - //Temperature related methods + //Temperature related methods + void setTemperatureCorrection(float corr); float readTempC( void ); float readTempF( void ); @@ -258,4 +259,4 @@ class BME280 float _referencePressure = 101325.0; //Default but is changeable }; -#endif // End of __BME280_H__ definition check \ No newline at end of file +#endif // End of __BME280_H__ definition check From 8e57734a46eb4f5425b170c76036520352bca139 Mon Sep 17 00:00:00 2001 From: AndyEngland521 Date: Wed, 27 Nov 2019 11:57:24 -0700 Subject: [PATCH 13/25] bumping library.properties to add get/set for temp correction --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 7fd0ba7..10c1a7e 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SparkFun BME280 -version=2.0.7 +version=2.0.8 author=SparkFun Electronics maintainer=SparkFun Electronics sentence=A library to drive the Bosch BME280 Altimeter and Pressure sensor From ebc56a7f1f546614ad10f4c0df47f64a4b7b98d2 Mon Sep 17 00:00:00 2001 From: ted Date: Fri, 2 Oct 2020 17:45:46 -0700 Subject: [PATCH 14/25] add some comments about "refPressure" There are too many units and names for this, so at least provide some hints to what it means. I'm already distracted and it's Friday so I put some Sparkfun style commentary in it. --- src/SparkFunBME280.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/SparkFunBME280.cpp b/src/SparkFunBME280.cpp index 31d5377..235e259 100644 --- a/src/SparkFunBME280.cpp +++ b/src/SparkFunBME280.cpp @@ -390,7 +390,13 @@ float BME280::readFloatPressure( void ) } -//Sets the internal variable _referencePressure so the +// Sets the internal variable _referencePressure so the altitude is calculated properly. +// This is also known as "sea level pressure" and is in Pascals. The value is probably +// within 10% of 101325. This varies based on the weather: +// https://en.wikipedia.org/wiki/Atmospheric_pressure#Mean_sea-level_pressure +// +// if you are concerned about accuracy or precision, make sure to pull the +// "sea level pressure"value from a trusted source like NOAA. void BME280::setReferencePressure(float refPressure) { _referencePressure = refPressure; @@ -406,7 +412,13 @@ float BME280::readFloatAltitudeMeters( void ) { float heightOutput = 0; - //heightOutput = ((float)-45846.2)*(pow(((float)readFloatPressure()/(float)_referencePressure), 0.190263) - (float)1); + // Getting height from a pressure reading is called the "international barometric height formula". + // The magic value of 44330.77 was adjusted in issue #30. + // There's also some discussion of it here: https://www.sparkfun.com/tutorials/253 + // This calculation is NOT designed to work on non-Earthlike planets such as Mars or Venus; + // see NRLMSISE-00. That's why it is the "international" formula, not "interplanetary". + // Sparkfun is not liable for incorrect altitude calculations from this + // code on those planets. Interplanetary selfies are welcome, however. heightOutput = ((float)-44330.77)*(pow(((float)readFloatPressure()/(float)_referencePressure), 0.190263) - (float)1); //Corrected, see issue 30 return heightOutput; From 9e01070491e60288e609801ea62a324af75287c3 Mon Sep 17 00:00:00 2001 From: santaimpersonator <36016723+santaimpersonator@users.noreply.github.com> Date: Thu, 8 Oct 2020 14:08:41 -0600 Subject: [PATCH 15/25] Link Qwiic BME280 product Link Qwiic BME280 product to listed products and product repositories, under documentation. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index abb6523..4602114 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,16 @@ Documentation -------------- * **[Installing an Arduino Library Guide](https://learn.sparkfun.com/tutorials/installing-an-arduino-library)** - Basic information on how to install an Arduino library. -* **[Product Repository](https://github.com/sparkfun/BME280-Breakout-Board)** - Main repository (including hardware files) for the SparkFun BME280 Breakout. +* **Product Repositories:** (including hardware files) + * [SparkFun BME280 Breakout](https://github.com/sparkfun/BME280-Breakout-Board) - Original product repository + * [SparkFun Environmental Combo Breakout - CCS811/BME280 (Qwiic)](https://www.sparkfun.com/products/14348) + * [SparkFun Atmospheric Sensor Breakout - BME280 (Qwiic)](https://github.com/sparkfun/Qwiic_Atmospheric_Sensor_Breakout_BME280) * **[Hookup Guide](https://learn.sparkfun.com/tutorials/sparkfun-bme280-breakout-hookup-guide)** - Basic hookup guide for the SparkFun BME280 Breakout. Products that use this Library --------------------------------- +* [*SEN-15440*](https://www.sparkfun.com/products/15440) * [*SEN-14348*](https://www.sparkfun.com/products/14348) * [*SEN-13676*](https://www.sparkfun.com/products/13676) From bbe667988d2c7ad1f1987968fa25aba15819f195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= Date: Sat, 24 Oct 2020 13:21:14 +0200 Subject: [PATCH 16/25] Include math.h SparkFunBME280.cpp uses math functions pow, log and log10. This produces errors such as "pow was not declared in this scope". Found this while packaging this library for RIOT-OS. The library works with Arduino because math.h is included somewhere else. But I think it's better or more correct to include the headers for the functions used. Fixes #48 --- src/SparkFunBME280.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SparkFunBME280.cpp b/src/SparkFunBME280.cpp index 235e259..1e624da 100644 --- a/src/SparkFunBME280.cpp +++ b/src/SparkFunBME280.cpp @@ -20,6 +20,7 @@ Distributed as-is; no warranty is given. ******************************************************************************/ //See SparkFunBME280.h for additional topology notes. +#include #include "SparkFunBME280.h" //****************************************************************************// From 76f67eb554ad3bce5c7d79094a68231c72241a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claudio=20Donat=C3=A9?= Date: Sat, 26 Dec 2020 00:06:19 -0300 Subject: [PATCH 17/25] feat: add read burst Read all measurements in one read command Read Datasheed section 4 Data readout for reason behing this feature --- src/SparkFunBME280.cpp | 104 +++++++++++++++++++++++++++++++++++++++++ src/SparkFunBME280.h | 15 ++++++ 2 files changed, 119 insertions(+) diff --git a/src/SparkFunBME280.cpp b/src/SparkFunBME280.cpp index 235e259..39a7e2e 100644 --- a/src/SparkFunBME280.cpp +++ b/src/SparkFunBME280.cpp @@ -355,6 +355,29 @@ void BME280::reset( void ) } +//****************************************************************************// +// +// Burst Measurement Section +// +//****************************************************************************// + +//Read all sensor registers as a burst. See BME280 Datasheet section 4. Data readout +//tempScale = 0 for Celsius scale +//tempScale = 1 for Fahrenheit scale +void BME280::readAllMeasurements(BME280_SensorMeasurements *measurements, byte tempScale){ + + uint8_t dataBurst[8]; + readRegisterRegion(dataBurst, BME280_MEASUREMENTS_REG, 8); + + if(tempScale == 0){ + readTempCFromBurst(dataBurst, measurements); + }else{ + readTempFFromBurst(dataBurst, measurements); + } + readFloatPressureFromBurst(dataBurst, measurements); + readFloatHumidityFromBurst(dataBurst, measurements); +} + //****************************************************************************// // // Pressure Section @@ -390,6 +413,37 @@ float BME280::readFloatPressure( void ) } +void BME280::readFloatPressureFromBurst(uint8_t buffer[], BME280_SensorMeasurements *measurements) +{ + + // Set pressure in Pa as unsigned 32 bit integer in Q24.8 format (24 integer bits and 8 fractional bits). + // Output value of “24674867” represents 24674867/256 = 96386.2 Pa = 963.862 hPa + + int32_t adc_P = ((uint32_t)buffer[0] << 12) | ((uint32_t)buffer[1] << 4) | ((buffer[2] >> 4) & 0x0F); + + int64_t var1, var2, p_acc; + var1 = ((int64_t)t_fine) - 128000; + var2 = var1 * var1 * (int64_t)calibration.dig_P6; + var2 = var2 + ((var1 * (int64_t)calibration.dig_P5)<<17); + var2 = var2 + (((int64_t)calibration.dig_P4)<<35); + var1 = ((var1 * var1 * (int64_t)calibration.dig_P3)>>8) + ((var1 * (int64_t)calibration.dig_P2)<<12); + var1 = (((((int64_t)1)<<47)+var1))*((int64_t)calibration.dig_P1)>>33; + if (var1 == 0) + { + measurements->pressure = 0; // avoid exception caused by division by zero + } + else + { + p_acc = 1048576 - adc_P; + p_acc = (((p_acc<<31) - var2)*3125)/var1; + var1 = (((int64_t)calibration.dig_P9) * (p_acc>>13) * (p_acc>>13)) >> 25; + var2 = (((int64_t)calibration.dig_P8) * p_acc) >> 19; + p_acc = ((p_acc + var1 + var2) >> 8) + (((int64_t)calibration.dig_P7)<<4); + + measurements->pressure = (float)p_acc / 256.0; + } +} + // Sets the internal variable _referencePressure so the altitude is calculated properly. // This is also known as "sea level pressure" and is in Pascals. The value is probably // within 10% of 101325. This varies based on the weather: @@ -459,6 +513,25 @@ float BME280::readFloatHumidity( void ) return (float)(var1>>12) / 1024.0; } +void BME280::readFloatHumidityFromBurst(uint8_t buffer[], BME280_SensorMeasurements *measurements) +{ + + // Set humidity in %RH as unsigned 32 bit integer in Q22. 10 format (22 integer and 10 fractional bits). + // Output value of “47445” represents 47445/1024 = 46. 333 %RH + int32_t adc_H = ((uint32_t)buffer[6] << 8) | ((uint32_t)buffer[7]); + + int32_t var1; + var1 = (t_fine - ((int32_t)76800)); + var1 = (((((adc_H << 14) - (((int32_t)calibration.dig_H4) << 20) - (((int32_t)calibration.dig_H5) * var1)) + + ((int32_t)16384)) >> 15) * (((((((var1 * ((int32_t)calibration.dig_H6)) >> 10) * (((var1 * ((int32_t)calibration.dig_H3)) >> 11) + ((int32_t)32768))) >> 10) + ((int32_t)2097152)) * + ((int32_t)calibration.dig_H2) + 8192) >> 14)); + var1 = (var1 - (((((var1 >> 15) * (var1 >> 15)) >> 7) * ((int32_t)calibration.dig_H1)) >> 4)); + var1 = (var1 < 0 ? 0 : var1); + var1 = (var1 > 419430400 ? 419430400 : var1); + + measurements->humidity = (float)(var1>>12) / 1024.0; +} + //****************************************************************************// // // Temperature Section @@ -494,6 +567,29 @@ float BME280::readTempC( void ) return output; } +float BME280::readTempFromBurst(uint8_t buffer[]) +{ + int32_t adc_T = ((uint32_t)buffer[3] << 12) | ((uint32_t)buffer[4] << 4) | ((buffer[5] >> 4) & 0x0F); + + //By datasheet, calibrate + int64_t var1, var2; + + var1 = ((((adc_T>>3) - ((int32_t)calibration.dig_T1<<1))) * ((int32_t)calibration.dig_T2)) >> 11; + var2 = (((((adc_T>>4) - ((int32_t)calibration.dig_T1)) * ((adc_T>>4) - ((int32_t)calibration.dig_T1))) >> 12) * + ((int32_t)calibration.dig_T3)) >> 14; + t_fine = var1 + var2; + float output = (t_fine * 5 + 128) >> 8; + + output = output / 100 + settings.tempCorrection; + + return output; +} + +void BME280::readTempCFromBurst(uint8_t buffer[], BME280_SensorMeasurements *measurements) +{ + measurements->temperature = readTempFromBurst(buffer); +} + float BME280::readTempF( void ) { float output = readTempC(); @@ -502,6 +598,14 @@ float BME280::readTempF( void ) return output; } +void BME280::readTempFFromBurst(uint8_t buffer[], BME280_SensorMeasurements *measurements) +{ + float output = readTempFromBurst(buffer); + output = (output * 9) / 5 + 32; + + measurements->temperature = output; +} + //****************************************************************************// // // Dew point Section diff --git a/src/SparkFunBME280.h b/src/SparkFunBME280.h index 77667b3..f2dc15b 100644 --- a/src/SparkFunBME280.h +++ b/src/SparkFunBME280.h @@ -105,6 +105,7 @@ Distributed as-is; no warranty is given. #define BME280_STAT_REG 0xF3 //Status Reg #define BME280_CTRL_MEAS_REG 0xF4 //Ctrl Measure Reg #define BME280_CONFIG_REG 0xF5 //Configuration Reg +#define BME280_MEASUREMENTS_REG 0xF7 //Measurements register start #define BME280_PRESSURE_MSB_REG 0xF7 //Pressure MSB #define BME280_PRESSURE_LSB_REG 0xF8 //Pressure LSB #define BME280_PRESSURE_XLSB_REG 0xF9 //Pressure XLSB @@ -172,6 +173,14 @@ struct SensorCalibration }; +struct BME280_SensorMeasurements +{ + public: + float temperature; + float pressure; + float humidity; +}; + //This is the main operational class of the driver. class BME280 @@ -215,18 +224,22 @@ class BME280 //Software reset routine void reset( void ); + void readAllMeasurements(BME280_SensorMeasurements *measurements, byte tempScale = 0); //Returns the values as floats. float readFloatPressure( void ); float readFloatAltitudeMeters( void ); float readFloatAltitudeFeet( void ); + void readFloatPressureFromBurst(uint8_t buffer[], BME280_SensorMeasurements *measurements); float readFloatHumidity( void ); + void readFloatHumidityFromBurst(uint8_t buffer[], BME280_SensorMeasurements *measurements); //Temperature related methods void setTemperatureCorrection(float corr); float readTempC( void ); float readTempF( void ); + float readTempFromBurst(uint8_t buffer[]); //Dewpoint related methods //From Pavel-Sayekat: https://github.com/sparkfun/SparkFun_BME280_Breakout_Board/pull/6/files @@ -248,6 +261,8 @@ class BME280 private: uint8_t checkSampleValue(uint8_t userValue); //Checks for valid over sample values + void readTempCFromBurst(uint8_t buffer[], BME280_SensorMeasurements *measurements); + void readTempFFromBurst(uint8_t buffer[], BME280_SensorMeasurements *measurements); uint8_t _wireType = HARD_WIRE; //Default to Wire.h TwoWire *_hardPort = NO_WIRE; //The generic connection to user's chosen I2C hardware From ac0b596992fa2364b541dfd7ed5a357d98e7cbec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claudio=20Donat=C3=A9?= Date: Wed, 30 Dec 2020 14:46:11 -0300 Subject: [PATCH 18/25] feat: create burst measurement example add documentation for the default scale on burst read --- .../Example11_BurstRead.ino | 68 +++++++++++++++++++ src/SparkFunBME280.cpp | 2 +- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 examples/Example11_BurstRead/Example11_BurstRead.ino diff --git a/examples/Example11_BurstRead/Example11_BurstRead.ino b/examples/Example11_BurstRead/Example11_BurstRead.ino new file mode 100644 index 0000000..0e0a2f7 --- /dev/null +++ b/examples/Example11_BurstRead/Example11_BurstRead.ino @@ -0,0 +1,68 @@ +/* + Get environmental readings as a burst from the BME280 + By: Claudio Donaté + Date: December 30th, 2020 + License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license). + + Feel like supporting our work? Buy a board from SparkFun! + https://www.sparkfun.com/products/14348 - Qwiic Combo Board + https://www.sparkfun.com/products/13676 - BME280 Breakout Board + + This example shows how to read humidity, pressure, and current temperature from the BME280 over I2C reading all registers at once. + Please check BME280 Datasheet, section 4, Data readout for detail explanations on why. + + Hardware connections: + BME280 -> Arduino + GND -> GND + 3.3 -> 3.3 + SDA -> A4 + SCL -> A5 +*/ + +#include + +#include "SparkFunBME280.h" + +#define CELSIUS_SCALE 0 //Default +#define FAHRENHEIT_SCALE 1 + +BME280 mySensor; +BME280_SensorMeasurements measurements; + +void setup() +{ + Serial.begin(9600); + Serial.println("Reading basic values from BME280 as a Burst"); + + Wire.begin(); + + if (mySensor.beginI2C() == false) //Begin communication over I2C + { + Serial.println("The sensor did not respond. Please check wiring."); + while(1); //Freeze + } +} + +void loop() +{ + while (mySensor.isMeasuring()) // Wait for sensor to finish measuring + { + Serial.print("."); + }; + + mySensor.readAllMeasurements(&measurements); // Return temperature in Celsius + // mySensor.readAllMeasurements(&measurements, FAHRENHEIT_SCALE); + + Serial.print("\nHumidity: "); + Serial.print(measurements.humidity, 0); + + Serial.print(" Pressure: "); + Serial.print(measurements.pressure, 0); + + Serial.print(" Temp: "); + Serial.print(measurements.temperature, 2); + + Serial.println(); + + delay(50); +} diff --git a/src/SparkFunBME280.cpp b/src/SparkFunBME280.cpp index 39a7e2e..0dc9920 100644 --- a/src/SparkFunBME280.cpp +++ b/src/SparkFunBME280.cpp @@ -362,7 +362,7 @@ void BME280::reset( void ) //****************************************************************************// //Read all sensor registers as a burst. See BME280 Datasheet section 4. Data readout -//tempScale = 0 for Celsius scale +//tempScale = 0 for Celsius scale (default setting) //tempScale = 1 for Fahrenheit scale void BME280::readAllMeasurements(BME280_SensorMeasurements *measurements, byte tempScale){ From 3b07e8c403a081d80683ad1046dbd0c5489ea1ad Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Wed, 30 Dec 2020 13:36:11 -0700 Subject: [PATCH 19/25] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4602114..3f3fc4b 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ Some examples include a circular buffer class for averaging. Thanks to: * calvin1564 for [fixing a name collision](https://github.com/sparkfun/SparkFun_BME280_Arduino_Library/pull/34) * LukaHitH for adding [BMP280 support](https://github.com/sparkfun/SparkFun_BME280_Arduino_Library/pull/23) +* cdonate for adding [burst read](https://github.com/sparkfun/SparkFun_BME280_Arduino_Library/pull/50) +* jdavid for integrating [math.h](https://github.com/sparkfun/SparkFun_BME280_Arduino_Library/pull/49) Repository Contents ------------------- From ab32ea0ea99c2b101d71690e31e2f9e133fb65dd Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Wed, 30 Dec 2020 13:40:56 -0700 Subject: [PATCH 20/25] Change examples to 115200bps to match style guide --- examples/Example10_DewPoint/Example10_DewPoint.ino | 2 +- examples/Example11_BurstRead/Example11_BurstRead.ino | 2 +- examples/Example1_BasicReadings/Example1_BasicReadings.ino | 2 +- examples/Example2_I2CAddress/Example2_I2CAddress.ino | 2 +- examples/Example3_CSVOutput/Example3_CSVOutput.ino | 2 +- examples/Example4_Settings/Example4_Settings.ino | 2 +- .../Example5_ReadAllRegisters/Example5_ReadAllRegisters.ino | 2 +- examples/Example6_LowPower/Example6_LowPower.ino | 2 +- .../Example7_RelativeAltitudeChange.ino | 2 +- examples/Example8_LocalPressure/Example8_LocalPressure.ino | 2 +- examples/Example9_SoftwareI2C/Example9_SoftwareI2C.ino | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/Example10_DewPoint/Example10_DewPoint.ino b/examples/Example10_DewPoint/Example10_DewPoint.ino index 6c1b4b6..fa0781b 100644 --- a/examples/Example10_DewPoint/Example10_DewPoint.ino +++ b/examples/Example10_DewPoint/Example10_DewPoint.ino @@ -25,7 +25,7 @@ BME280 mySensor; void setup() { - Serial.begin(9600); + Serial.begin(115200); Serial.println("Example showing dewpoint calculation"); mySensor.setI2CAddress(0x76); //Connect to a second sensor diff --git a/examples/Example11_BurstRead/Example11_BurstRead.ino b/examples/Example11_BurstRead/Example11_BurstRead.ino index 0e0a2f7..6e94e7f 100644 --- a/examples/Example11_BurstRead/Example11_BurstRead.ino +++ b/examples/Example11_BurstRead/Example11_BurstRead.ino @@ -31,7 +31,7 @@ BME280_SensorMeasurements measurements; void setup() { - Serial.begin(9600); + Serial.begin(115200); Serial.println("Reading basic values from BME280 as a Burst"); Wire.begin(); diff --git a/examples/Example1_BasicReadings/Example1_BasicReadings.ino b/examples/Example1_BasicReadings/Example1_BasicReadings.ino index a4078f8..3fe99c4 100644 --- a/examples/Example1_BasicReadings/Example1_BasicReadings.ino +++ b/examples/Example1_BasicReadings/Example1_BasicReadings.ino @@ -26,7 +26,7 @@ BME280 mySensor; void setup() { - Serial.begin(9600); + Serial.begin(115200); Serial.println("Reading basic values from BME280"); Wire.begin(); diff --git a/examples/Example2_I2CAddress/Example2_I2CAddress.ino b/examples/Example2_I2CAddress/Example2_I2CAddress.ino index d277347..7d97120 100644 --- a/examples/Example2_I2CAddress/Example2_I2CAddress.ino +++ b/examples/Example2_I2CAddress/Example2_I2CAddress.ino @@ -27,7 +27,7 @@ BME280 mySensorB; //Uses I2C address 0x76 (jumper closed) void setup() { - Serial.begin(9600); + Serial.begin(115200); Serial.println("Example showing alternate I2C addresses"); Wire.begin(); diff --git a/examples/Example3_CSVOutput/Example3_CSVOutput.ino b/examples/Example3_CSVOutput/Example3_CSVOutput.ino index 03e9d43..cb34eff 100644 --- a/examples/Example3_CSVOutput/Example3_CSVOutput.ino +++ b/examples/Example3_CSVOutput/Example3_CSVOutput.ino @@ -21,7 +21,7 @@ unsigned long sampleNumber = 0; void setup() { - Serial.begin(9600); + Serial.begin(115200); Wire.begin(); diff --git a/examples/Example4_Settings/Example4_Settings.ino b/examples/Example4_Settings/Example4_Settings.ino index b9e61f9..f51b795 100644 --- a/examples/Example4_Settings/Example4_Settings.ino +++ b/examples/Example4_Settings/Example4_Settings.ino @@ -17,7 +17,7 @@ BME280 mySensor; void setup() { - Serial.begin(9600); + Serial.begin(115200); Serial.println("Example showing alternate I2C addresses"); Wire.begin(); diff --git a/examples/Example5_ReadAllRegisters/Example5_ReadAllRegisters.ino b/examples/Example5_ReadAllRegisters/Example5_ReadAllRegisters.ino index f15eda4..85acc6a 100644 --- a/examples/Example5_ReadAllRegisters/Example5_ReadAllRegisters.ino +++ b/examples/Example5_ReadAllRegisters/Example5_ReadAllRegisters.ino @@ -23,7 +23,7 @@ BME280 mySensor; void setup() { - Serial.begin(9600); + Serial.begin(115200); while(!Serial); //Needed for printing correctly when using a Teensy Serial.println("Reading all registers from BME280"); diff --git a/examples/Example6_LowPower/Example6_LowPower.ino b/examples/Example6_LowPower/Example6_LowPower.ino index e2fd8a6..c42abe8 100644 --- a/examples/Example6_LowPower/Example6_LowPower.ino +++ b/examples/Example6_LowPower/Example6_LowPower.ino @@ -18,7 +18,7 @@ BME280 mySensor; void setup() { - Serial.begin(9600); + Serial.begin(115200); Serial.println("Example showing alternate I2C addresses"); Wire.begin(); diff --git a/examples/Example7_RelativeAltitudeChange/Example7_RelativeAltitudeChange.ino b/examples/Example7_RelativeAltitudeChange/Example7_RelativeAltitudeChange.ino index 7b3e136..586ed2d 100644 --- a/examples/Example7_RelativeAltitudeChange/Example7_RelativeAltitudeChange.ino +++ b/examples/Example7_RelativeAltitudeChange/Example7_RelativeAltitudeChange.ino @@ -41,7 +41,7 @@ float localAltitude = 0; void setup() { - Serial.begin(9600); + Serial.begin(115200); while(!Serial); //Wait for user to get terminal open Serial.println("Output a local changing altitude"); Serial.println("Press any key to zero local altitude"); diff --git a/examples/Example8_LocalPressure/Example8_LocalPressure.ino b/examples/Example8_LocalPressure/Example8_LocalPressure.ino index d1a4fcd..552be86 100644 --- a/examples/Example8_LocalPressure/Example8_LocalPressure.ino +++ b/examples/Example8_LocalPressure/Example8_LocalPressure.ino @@ -25,7 +25,7 @@ BME280 mySensor; void setup() { - Serial.begin(9600); + Serial.begin(115200); Serial.println("Example showing alternate I2C addresses"); Wire.begin(); diff --git a/examples/Example9_SoftwareI2C/Example9_SoftwareI2C.ino b/examples/Example9_SoftwareI2C/Example9_SoftwareI2C.ino index b5c3c6a..f47d0b1 100644 --- a/examples/Example9_SoftwareI2C/Example9_SoftwareI2C.ino +++ b/examples/Example9_SoftwareI2C/Example9_SoftwareI2C.ino @@ -31,7 +31,7 @@ BME280 mySensor; void setup() { - Serial.begin(9600); + Serial.begin(115200); Serial.println("Example showing alternate I2C addresses"); myWire.begin(); From d2eda03f8ded9f1621e37bf5217f08b7548848a3 Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Wed, 30 Dec 2020 13:42:31 -0700 Subject: [PATCH 21/25] Remove Wire.begin() from begin() --- src/SparkFunBME280.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/SparkFunBME280.cpp b/src/SparkFunBME280.cpp index b7085f6..b1136c3 100644 --- a/src/SparkFunBME280.cpp +++ b/src/SparkFunBME280.cpp @@ -71,17 +71,18 @@ uint8_t BME280::begin() case I2C_MODE: - switch(_wireType) - { - case(HARD_WIRE): - _hardPort->begin(); //The caller can begin their port and set the speed. We just confirm it here otherwise it can be hard to debug. - break; - case(SOFT_WIRE): - #ifdef SoftwareWire_h - _softPort->begin(); //The caller can begin their port and set the speed. We just confirm it here otherwise it can be hard to debug. - #endif - break; - } + //Removing port begin from library. This should be done by user otherwise this library will overwrite Wire settings such as clock speed. + // switch(_wireType) + // { + // case(HARD_WIRE): + // _hardPort->begin(); //The caller can begin their port and set the speed. We just confirm it here otherwise it can be hard to debug. + // break; + // case(SOFT_WIRE): + // #ifdef SoftwareWire_h + // _softPort->begin(); //The caller can begin their port and set the speed. We just confirm it here otherwise it can be hard to debug. + // #endif + // break; + // } break; case SPI_MODE: From 0b5eabfe23cf8fb463b2e7c32bfe9152d26dc64d Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Wed, 30 Dec 2020 20:44:27 -0700 Subject: [PATCH 22/25] Update library.properties --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 10c1a7e..bb3733d 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SparkFun BME280 -version=2.0.8 +version=2.0.9 author=SparkFun Electronics maintainer=SparkFun Electronics sentence=A library to drive the Bosch BME280 Altimeter and Pressure sensor From 55768beb0cf69166558326e54f5a02249e9fd842 Mon Sep 17 00:00:00 2001 From: Jonas Lauer Date: Sat, 7 May 2022 20:42:46 +0200 Subject: [PATCH 23/25] change byte to uint8_t to avoid naming conflict with ESP8266 toolchain --- src/SparkFunBME280.cpp | 2 +- src/SparkFunBME280.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SparkFunBME280.cpp b/src/SparkFunBME280.cpp index b1136c3..dac7ab1 100644 --- a/src/SparkFunBME280.cpp +++ b/src/SparkFunBME280.cpp @@ -366,7 +366,7 @@ void BME280::reset( void ) //Read all sensor registers as a burst. See BME280 Datasheet section 4. Data readout //tempScale = 0 for Celsius scale (default setting) //tempScale = 1 for Fahrenheit scale -void BME280::readAllMeasurements(BME280_SensorMeasurements *measurements, byte tempScale){ +void BME280::readAllMeasurements(BME280_SensorMeasurements *measurements, uint8_t tempScale){ uint8_t dataBurst[8]; readRegisterRegion(dataBurst, BME280_MEASUREMENTS_REG, 8); diff --git a/src/SparkFunBME280.h b/src/SparkFunBME280.h index f2dc15b..f169b2b 100644 --- a/src/SparkFunBME280.h +++ b/src/SparkFunBME280.h @@ -224,7 +224,7 @@ class BME280 //Software reset routine void reset( void ); - void readAllMeasurements(BME280_SensorMeasurements *measurements, byte tempScale = 0); + void readAllMeasurements(BME280_SensorMeasurements *measurements, uint8_t tempScale = 0); //Returns the values as floats. float readFloatPressure( void ); From 56e7ff4723ff19ba3438eeecf9a6ea39a06cb47c Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Mon, 9 May 2022 08:15:59 -0600 Subject: [PATCH 24/25] Update library.properties --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index bb3733d..4601130 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SparkFun BME280 -version=2.0.9 +version=2.0.10 author=SparkFun Electronics maintainer=SparkFun Electronics sentence=A library to drive the Bosch BME280 Altimeter and Pressure sensor From c42e78089d9cda457d616715b41c970e253c2acf Mon Sep 17 00:00:00 2001 From: SFEMark Date: Tue, 19 Sep 2023 14:53:45 -0600 Subject: [PATCH 25/25] Create add_issue_to_project.yml Adding issue tracking .yml file for issue tracking in GH Projects. --- .github/workflows/add_issue_to_project.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/add_issue_to_project.yml diff --git a/.github/workflows/add_issue_to_project.yml b/.github/workflows/add_issue_to_project.yml new file mode 100644 index 0000000..6b60cc3 --- /dev/null +++ b/.github/workflows/add_issue_to_project.yml @@ -0,0 +1,18 @@ +name: Add new issue to our main project + +on: + issues: + types: + - opened + +jobs: + add-to-project: + name: Add issue to project + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@main + with: + # You can target a project in a different organization + # to the issue + project-url: https://github.com/orgs/sparkfun/projects/19 + github-token: ${{ secrets.DEFECT_ADD_TO_PROJECT }} pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy