Espruino module for BMP280

This module reads values from Bosch Sensortec's BMP280 sensor. Use the BMP280 module for it.

Wiring

You can wire this up as follows:

Device Pin Espruino
1 (GND) GND
8 (VCore) 3.3
3 (SDI) B9(I2C1 SDA)
4 (SCK) B8(I2C1 SCL)
2(CSB) 3.3
5(SDO) GND
6(Vio) 3.3

Don't forget to pull-up both of the I2C pins with 10k resistors.

Software

  I2C1.setup({scl:B8,sda:B9});
  var bmp = require("BMP280").connect(I2C1);
  bmp.readRawData();
  var temp_cal = bmp.calibration_T(bmp.temp_raw);
  var press_cal = bmp.calibration_P(bmp.pres_raw);
  var temp_act = temp_cal / 100.0;
  var press_act = press_cal / 100.0;

  console.log("Pressure: " + press_act + " hPa");
  console.log("Temperature: " + temp_act + " C");

To save space, debugging is now turned off on this module. To enable debugging, make a local copy of the module, uncomment lines where indicated, and connect like so:

  var bmp = require("BMP280").connect(I2C1, {debug:true});

This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.