jvsbme680
v1.0.4
Published
An easy-to-use Node.js module for Pimoroni's BME680 Breakout
Downloads
57
Maintainers
Readme
JVSBME680
An easy-to-use Node.js module for Pimoroni's BME680 Breakout
Features
JVSBME680 allows you to make use of (almost) all features available in Pimoroni's Python library.
Hardware requirements
- Raspberry Pi
- Pimoroni BME680 Breakout
Installation
Note: these installation instructions assume that your Raspberry Pi is running an installation of Raspbian Stretch, with both Node.js v8.x and npm installed. Additionally, JVSBME680 requires Python 2.x or later, which should come pre-installed with Raspbian.
Need help installing Node.js and npm? I've written an extensive tutorial, which you can find here.
Preparing for the installation
First of all, make sure your Raspberry Pi is up-to-date:
sudo apt-get update && sudo apt-get dist-upgrade
Install Pimoroni's Python library using their super-easy installation script:
curl https://get.pimoroni.com/bme680 | bash
Reboot the Raspberry Pi.
Installing JVSBME680
Use
cd
to navigate to your Node.js project directory.Install JVSBME680 using npm:
npm install jvsbme680 --save
Usage
Start by loading the module:
const { BME680 } = require('jvsbme680');
Initialize the BME680 object:
const bme680 = new BME680();
Note: if you'd like to use two BME680 Breakout boards simultaneously, you can simply pass the I2C address (as a string
) to the constructor. See the documentation of the Constants class for valid values. The Constants
class is exported by the module, together with the BME680
class.
The initialized BME680 object has a number of properties, allowing you to access each sensor of the BME680:
gasSensor
- an initializedGasSensor
object for accessing the gas sensorhumiditySensor
- an initializedHumiditySensor
object for accessing the humidity sensorpressureSensor
- an initializedPressureSensor
object for accessing the pressure sensortemperatureSensor
- an initializedTemperatureSensor
object for accessing the temperature sensor
Documentation for each of the above mentioned components can be found here.
Code examples that show how to use JVSBME680 can be found here.
License
MIT License
Copyright (c) 2017 Joris Vervuurt Software
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.