Giter Site home page Giter Site logo

malokhvii-eduard / arduino-bme280 Goto Github PK

View Code? Open in Web Editor NEW
33.0 1.0 1.0 82 KB

๐Ÿ’ง Arduino library for Bosch Sensortec BME280 โ€“ combined temperature, pressure, humidity sensor. The library allows using the sensor over I2C or SPI on any board that supports Arduino.

Home Page: https://registry.platformio.org/libraries/malokhvii-eduard/arduino-bme280

License: MIT License

C++ 99.69% Python 0.09% Shell 0.22%
bme280 spi i2c arduino library platformio temperature pressure humidity bosch

arduino-bme280's Introduction

๐Ÿ’ง Arduino library for Bosch Sensortec BME280

The library allows using the sensor over I2C or SPI on any board that supports Arduino.

License Husky Commitizen semantic-release Style Guide clang-format markdownlint commitlint Tested on Arduino Uno Tested on Arduino Nano Tested on NodeMCU Tested on Wemos D1 Code Coverage CI Workflow Release Workflow

๐ŸŽ‰ Features

โœจ Getting Started

๐Ÿ“ฆ Installation

๐Ÿ‘‰ PlatformIO

Run pio lib install "malokhvii-eduard/arduino-bme280" or declare in platformio.ini configuration file using lib_deps option. Enjoy! ๐ŸŽ‰๐Ÿ‘

๐Ÿ‘‰ Arduino IDE (Library Manager)

Go to the Arduino IDE and click Tools > Manage Libraries. In the library manager dialogue that opens, enter search query Bme280. Afterward, find a library Bme280 by Eduard Malokhvii and click Install. Enjoy! ๐ŸŽ‰๐Ÿ‘

๐Ÿ‘‰ Arduino IDE (Manual)

Download Bme280.zip from release assets. Once downloaded, go to the Arduino IDE and click Sketch > Include Library > Add .zip Library. In the file dialogue that opens, locate your downloaded ZIP file. Afterward, you should receive a Library Added message just above the debug window. Enjoy! ๐ŸŽ‰๐Ÿ‘

๐Ÿ‘€ Usage

There are various examples to demonstrate usage of the library. The examples are listed below:

โ“ FAQs

๐Ÿ™‹โ€โ™‚๏ธ In which units temperature, pressure, humidity are measured?

๐Ÿ‘‰ The temperature is measured in degrees Celsius (symbol: ยฐC). The pressure is measured in pascals (symbol: Pa). The humidity is measured in percentages (symbol: %).

๐Ÿ™‹โ€โ™‚๏ธ What settings are used by default?

๐Ÿ‘‰ The default settings are:

  • mode โ€“ Bme280Mode::Normal
  • temperature oversampling โ€“ Bme280Oversampling::X16
  • pressure oversampling โ€“ Bme280Oversampling::X16
  • humidity oversampling โ€“ Bme280Oversampling::X16
  • filter โ€“ Bme280Filter::Off
  • standby time โ€“ Bme280StandbyTime::Ms0_5

๐Ÿ™‹โ€โ™‚๏ธ Are there any settings presets out-of-the-box?

๐Ÿ‘‰ Yes. There are some settings presets out-of-the-box according to the recomendations in the datasheet. You can create settings preset by call one of factory methods in Bme280Settings. The factory methods are listed below:

  • Bme280Settings::indoor()
  • Bme280Settings::weatherMonitoring()
  • Bme280Settings::gaming()
  • Bme280Settings::humiditySensing()

๐Ÿ™‹โ€โ™‚๏ธ How to off one of any measurements?

๐Ÿ‘‰ Assign Bme280Oversampling::Off to an oversampling in settings.

๐Ÿ™‹โ€โ™‚๏ธ How does it work?

๐Ÿ‘‰ You can explore unit tests to see the behavior of all library members.

๐Ÿ› ๏ธ Tech Stack

EditorConfig Markdown C++ PlatformIO Arduino Google Test gcovr npm clang-format Prettier markdownlint commitlint semantic-release BME280 Shields.io Git GitHub GitHub Actions

โœ๏ธ Contributing

๐Ÿ‘๐ŸŽ‰ First off, thanks for taking the time to contribute! ๐ŸŽ‰๐Ÿ‘

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/awesome-feature)
  3. Commit your Changes (git commit -m 'Add awesome feature')
  4. Push to the Branch (git push origin feature/awesome-feature)
  5. Open a Pull Request

๐Ÿ’– Like this project?

Leave a โญ if you think this project is cool or useful for you.

โš ๏ธ License

arduino-bme280 is licenced under the MIT License. See the LICENSE for more information.

arduino-bme280's People

Contributors

malokhvii-eduard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

birchtech

arduino-bme280's Issues

Feature request: check if sensor is present

Hello,
using BME280 in I2C with ESP32. Arduino IDE 1.8.19, latest Arduino-ESP32 core (2.0.14).

Even if no sensor is attached I can call sensor.begin(), setSettings(), getTemperature() etc.: I can't seem to have a way to tell if a sensor is actually present/working.

It would be nice to have for, example, begin() returning false if the BME280 is not attached or not responding.
Or maybe it already works this way, but I cannot find the API documentation so I don't know if begin() returns something.

Thanks for reading.

Set a specific (setting) parameter, starting from a factory preset

Hello, thanks for the library.

Let's say I want to set the BME280 in Forced mode, while all other settings I would take from the "indoor" preset.
How would I do that, is there an example? Only found examples about enabling one of the presets (Settings.ino) as is.
Thanks

Code is locked in setup if sensor is not present at boot time

Hi!

I just used this library and if sensor is not connected at boot time, then program stays in setup in an infinite loop.

void setup() {
  Serial.begin(9600);
  Wire.begin(D2, D1);

  Serial.println();

  sensor.begin(Bme280TwoWireAddress::Primary);  <---- here
  sensor.setSettings(Bme280Settings::indoor());
}

Bme280.cpp:

  while (isImUpdate()) {   <--- because of this
    delay(20);
  }

I fixed it by changing with:

 isImUpdate();

Is this code lock done intentionally or is it just a mistake?

Thank you, regards,
Peter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.