Skip to content

Commit

Permalink
Development v1.0.10 fixes to master (#35)
Browse files Browse the repository at this point in the history
* Updated to new version

* Updated to new version

* Issue #31 addressed for incorrect humidity computation

* Issue #32

Changed multiplication and division by powers of 2 to bit-shift operations for clarity

* Issue #33

Also corrected travis-ci links

* Issue #33

Corrected "const" definition

* Issues #33 and #34

* Issue #34

Corrections to formatting

* Issue #34 changes

Co-authored-by: Arnd <[email protected]>
  • Loading branch information
Arnd and Arnd authored Dec 3, 2020
1 parent 4ed2350 commit 2dc7b25
Show file tree
Hide file tree
Showing 9 changed files with 517 additions and 189 deletions.
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BME680 library <img src="https://github.com/SV-Zanshin/BME680/blob/master/Images/bosch-bme680.jpg" alt="Bosch BME680" align="right" height="60px"><br>[![License: GPL v3](https://zanduino.github.io/Badges/GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Build Status](https://travis-ci.org/SV-Zanshin/BME680.svg?branch=master)](https://travis-ci.org/SV-Zanshin/BME680) [![arduino-library-badge](https://www.ardu-badge.com/badge/BME680.svg?)](https://www.ardu-badge.com/BME680) [![DOI](https://zenodo.org/badge/139349456.svg)](https://zenodo.org/badge/latestdoi/139349456) [![Doxygen](https://zanduino.github.io/Badges/Doxygen-Badge.svg)](https://sv-zanshin.github.io/BME680/html/index.html) [![Wiki](https://zanduino.github.io/Badges/Documentation-Badge.svg)](https://github.com/SV-Zanshin/BME680/wiki)
# BME680 library <img src="https://github.com/SV-Zanshin/BME680/blob/master/Images/bosch-bme680.jpg" alt="Bosch BME680" align="right" height="60px"><br>[![License: GPL v3](https://zanduino.github.io/Badges/GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Build Status](https://travis-ci.com/SV-Zanshin/BME680.svg?branch=master)](https://travis-ci.com/SV-Zanshin/BME680) [![arduino-library-badge](https://www.ardu-badge.com/badge/BME680.svg?)](https://www.ardu-badge.com/BME680) [![DOI](https://zenodo.org/badge/139349456.svg)](https://zenodo.org/badge/latestdoi/139349456) [![Doxygen](https://zanduino.github.io/Badges/Doxygen-Badge.svg)](https://sv-zanshin.github.io/BME680/html/index.html) [![Wiki](https://zanduino.github.io/Badges/Documentation-Badge.svg)](https://github.com/SV-Zanshin/BME680/wiki)

*Arduino* library for using the [Bosch BME680](https://www.bosch-sensortec.com/bst/products/all_products/bme680) sensor which senses temperature, humidity and pressure. The BME680 is a tiny package and no hobbyist is going to be breadboarding this sensor directly, so one will be part of a breakout board. Here are some breakout board examples:

Expand Down
294 changes: 294 additions & 0 deletions Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
######################################################################################################
## Doxygen control file for Version 1.8.16 ##
## ##
## Date Developer Comments ##
## ========== ============================= ======================================================= ##
## 2020-09-27 https://github.com/SV-Zanshin Updated version to 1.0.10 ##
## 2020-06-25 https://github.com/SV-Zanshin Updated version to 1.0.9 ##
## 2020-06-25 https://github.com/SV-Zanshin Updated version to 1.0.8 ##
## 2020-06-08 https://github.com/SV-Zanshin Updated version to 1.0.7 ##
## 2020-06-01 https://github.com/SV-Zanshin Added "PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS" ##
## 2020-05-23 https://github.com/SV-Zanshin Removed e-mail addresses from file and updated version ##
## 2020-05-21 https://github.com/SV-Zanshin Updated "PROJECT_NUMBER" value to 1.0.5 ##
## 2020-05-17 https://github.com/SV-Zanshin Updated "PROJECT_NUMBER" value to 1.0.4 ##
## 2020-05-10 https://github.com/SV-Zanshin Removed all comments in order to compact this file ##
## ##
######################################################################################################
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = BME680
PROJECT_NUMBER = "Version 1.0.10"
PROJECT_BRIEF = "Arduino Library for the Bosch BME680 Temperature, Humidity, Pressure and Gas sensor"
PROJECT_LOGO =
OUTPUT_DIRECTORY =
CREATE_SUBDIRS = NO
ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 2
ALIASES =
TCL_SUBST =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = ino=c
MARKDOWN_SUPPORT = YES
TOC_INCLUDE_HEADINGS = 0
AUTOLINK_SUPPORT = YES
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
GROUP_NESTED_COMPOUNDS = NO
SUBGROUPING = YES
INLINE_GROUPED_CLASSES = NO
INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
LOOKUP_CACHE_SIZE = 0
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_PACKAGE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = NO
HIDE_SCOPE_NAMES = NO
HIDE_COMPOUND_REFERENCE= NO
SHOW_INCLUDE_FILES = YES
SHOW_GROUPED_MEMB_INC = NO
FORCE_LOCAL_INCLUDES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_MEMBERS_CTORS_1ST = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
STRICT_PROTO_MATCHING = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
CITE_BIB_FILES =
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_AS_ERROR = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
INPUT = src examples
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.ino \
*.c \
*.cpp \
*.h
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
FILTER_SOURCE_PATTERNS =
USE_MDFILE_AS_MAINPAGE =
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
REFERENCES_LINK_SOURCE = YES
SOURCE_TOOLTIPS = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
CLANG_ASSISTED_PARSING = NO
CLANG_OPTIONS =
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET =
HTML_EXTRA_FILES =
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_GAMMA = 80
HTML_TIMESTAMP = NO
HTML_DYNAMIC_SECTIONS = NO
HTML_INDEX_NUM_ENTRIES = 100
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
DOCSET_PUBLISHER_NAME = Publisher
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
GENERATE_QHP = NO
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHP_CUST_FILTER_NAME =
QHP_CUST_FILTER_ATTRS =
QHP_SECT_FILTER_ATTRS =
QHG_LOCATION =
GENERATE_ECLIPSEHELP = NO
ECLIPSE_DOC_ID = org.doxygen.Project
DISABLE_INDEX = NO
GENERATE_TREEVIEW = YES
ENUM_VALUES_PER_LINE = 4
TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
USE_MATHJAX = NO
MATHJAX_FORMAT = HTML-CSS
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
MATHJAX_EXTENSIONS =
MATHJAX_CODEFILE =
SEARCHENGINE = YES
SERVER_BASED_SEARCH = NO
EXTERNAL_SEARCH = NO
SEARCHENGINE_URL =
SEARCHDATA_FILE = searchdata.xml
EXTERNAL_SEARCH_ID =
EXTRA_SEARCH_MAPPINGS =
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
COMPACT_LATEX = NO
PAPER_TYPE = a4
EXTRA_PACKAGES =
LATEX_HEADER =
LATEX_FOOTER =
LATEX_EXTRA_STYLESHEET =
LATEX_EXTRA_FILES =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_SOURCE_CODE = NO
LATEX_BIB_STYLE = plain
LATEX_TIMESTAMP = NO
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_SOURCE_CODE = NO
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_SUBDIR =
MAN_LINKS = NO
GENERATE_XML = NO
XML_OUTPUT = xml
XML_PROGRAMLISTING = YES
GENERATE_DOCBOOK = NO
DOCBOOK_OUTPUT = docbook
DOCBOOK_PROGRAMLISTING = NO
GENERATE_AUTOGEN_DEF = NO
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
CLASS_DIAGRAMS = YES
DIA_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
DOT_NUM_THREADS = 0
DOT_FONTNAME = Helvetica
DOT_FONTSIZE = 10
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
UML_LIMIT_NUM_FIELDS = 10
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
INTERACTIVE_SVG = NO
DOT_PATH =
DOTFILE_DIRS =
MSCFILE_DIRS =
DIAFILE_DIRS =
PLANTUML_JAR_PATH =
PLANTUML_CFG_FILE =
PLANTUML_INCLUDE_PATH =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
50 changes: 26 additions & 24 deletions examples/I2CDemo/I2CDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ Written by Arnd\@SV-Zanshin
Version | Date | Developer | Comments
------- | ---------- | ---------- | ---------------------------------------------------------------
1.0.3 | 2020-07-04 | SV-Zanshin | Issue #25 - implement clang-formatting
1.0.2 | 2020-05-09 | SV-Zanshin | Issue #8 - clean up comments and code
1.0.1 | 2019-01-30 | SV-Zanshin | Removed old comments
1.0.1 | 2019-01-26 | SV-Zanshin | Issue #3 - convert documentation to Doxygen
1.0.0b | 2018-06-30 | SV-Zanshin | Cloned from original BME280 program
1.0.3 | 2020-07-04 | SV-Zanshin | Issue #25 implement clang-formatting
1.0.2 | 2020-05-09 | SV-Zanshin | Issue #8 clean up comments and code
1.0.1 | 2019-01-30 | SV-Zanshin | Removed old comments
1.0.1 | 2019-01-26 | SV-Zanshin | Issue #3 convert documentation to Doxygen
1.0.0b | 2018-06-30 | SV-Zanshin | Cloned from original BME280 program
*/
#include "Zanshin_BME680.h" // Include the BME680 Sensor library
/**************************************************************************************************
** Declare all program constants **
**************************************************************************************************/
const uint32_t SERIAL_SPEED = 115200; ///< Set the baud rate for Serial I/O
const uint32_t SERIAL_SPEED{115200}; ///< Set the baud rate for Serial I/O

/**************************************************************************************************
** Declare global variables and instantiate classes **
Expand Down Expand Up @@ -107,7 +107,7 @@ void setup() {
#endif
Serial.print(F("Starting I2CDemo example program for BME680\n"));
Serial.print(F("- Initializing BME680 sensor\n"));
while (!BME680.begin(I2C_STANDARD_MODE)) { // Start BME680 using I2C, use first device found
while (!BME680.begin(I2C_STANDARD_MODE)) { // Start BME680 using I2C, use first device found
Serial.print(F("- Unable to find BME680. Trying again in 5 seconds.\n"));
delay(5000);
} // of loop until device is located
Expand Down Expand Up @@ -136,21 +136,23 @@ void loop() {
if (loopCounter % 25 == 0) { // Show header @25 loops
Serial.print(F("\nLoop Temp\xC2\xB0\x43 Humid% Press hPa Alt m Air m"));
Serial.print(F("\xE2\x84\xA6\n==== ====== ====== ========= ======= ======\n")); // "°C" symbol
} // if-then time to show headers
BME680.getSensorData(temp, humidity, pressure, gas); // Get readings
sprintf(buf, "%4d %3d.%02d", ++loopCounter % 9999, // Clamp to 9999,
(int8_t)(temp / 100), (uint8_t)(temp % 100)); // Temp in decidegrees
Serial.print(buf);
sprintf(buf, "%3d.%03d", (int8_t)(humidity / 1000),
(uint16_t)(humidity % 1000)); // Humidity milli-pct
Serial.print(buf);
sprintf(buf, "%7d.%02d", (int16_t)(pressure / 100),
(uint8_t)(pressure % 100)); // Pressure Pascals
Serial.print(buf);
alt = altitude(pressure); // temp altitude
sprintf(buf, "%5d.%02d", (int16_t)(alt), ((uint8_t)(alt * 100) % 100)); // Altitude meters
Serial.print(buf);
sprintf(buf, "%4d.%02d\n", (int16_t)(gas / 100), (uint8_t)(gas % 100)); // Resistance milliohms
Serial.print(buf);
delay(10000); // Wait 10s
} // if-then time to show headers
BME680.getSensorData(temp, humidity, pressure, gas); // Get readings
if (loopCounter++ != 0) { // Ignore first reading, might be incorrect
sprintf(buf, "%4d %3d.%02d", (loopCounter - 1) % 9999, // Clamp to 9999,
(int8_t)(temp / 100), (uint8_t)(temp % 100)); // Temp in decidegrees
Serial.print(buf);
sprintf(buf, "%3d.%03d", (int8_t)(humidity / 1000),
(uint16_t)(humidity % 1000)); // Humidity milli-pct
Serial.print(buf);
sprintf(buf, "%7d.%02d", (int16_t)(pressure / 100),
(uint8_t)(pressure % 100)); // Pressure Pascals
Serial.print(buf);
alt = altitude(pressure); // temp altitude
sprintf(buf, "%5d.%02d", (int16_t)(alt), ((uint8_t)(alt * 100) % 100)); // Altitude meters
Serial.print(buf);
sprintf(buf, "%4d.%02d\n", (int16_t)(gas / 100), (uint8_t)(gas % 100)); // Resistance milliohms
Serial.print(buf);
delay(10000); // Wait 10s
} // of ignore first reading
} // of method loop()
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Example programs for the BME680 library<br>[![License: GPL v3](https://zanduino.github.io/Badges/GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Build Status](https://travis-ci.org/SV-Zanshin/BME680.svg?branch=master)](https://travis-ci.org/SV-Zanshin/BME680) [![arduino-library-badge](https://www.ardu-badge.com/badge/BME680.svg?)](https://www.ardu-badge.com/BME680) [![DOI](https://zenodo.org/badge/139349456.svg)](https://zenodo.org/badge/latestdoi/139349456) [![Doxygen](https://zanduino.github.io/Badges/Doxygen-Badge.svg)](https://sv-zanshin.github.io/BME680/html/index.html) [![Wiki](https://zanduino.github.io/Badges/Documentation-Badge.svg)](https://github.com/SV-Zanshin/BME680/wiki)
# Example programs for the BME680 library<br>[![License: GPL v3](https://zanduino.github.io/Badges/GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Build Status](https://travis-ci.com/SV-Zanshin/BME680.svg?branch=master)](https://travis-ci.com/SV-Zanshin/BME680) [![arduino-library-badge](https://www.ardu-badge.com/badge/BME680.svg?)](https://www.ardu-badge.com/BME680) [![DOI](https://zenodo.org/badge/139349456.svg)](https://zenodo.org/badge/latestdoi/139349456) [![Doxygen](https://zanduino.github.io/Badges/Doxygen-Badge.svg)](https://sv-zanshin.github.io/BME680/html/index.html) [![Wiki](https://zanduino.github.io/Badges/Documentation-Badge.svg)](https://github.com/SV-Zanshin/BME680/wiki)

Various example programs illustrating the use of the *Arduino* BME680 library are included in this directory and sub-directories.

Expand Down
Loading

0 comments on commit 2dc7b25

Please sign in to comment.