From 0a11e84f360f667da2ed7fc6104bce0cc50acd2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20St=C3=B6r?= Date: Tue, 22 Aug 2017 22:22:36 +0200 Subject: [PATCH] Add note to BME280 docs A delay is required between `setup` and reading from sensor. Fixes #1994. --- docs/en/modules/bme280.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/en/modules/bme280.md b/docs/en/modules/bme280.md index 2b71cfe4..faa7d9b9 100644 --- a/docs/en/modules/bme280.md +++ b/docs/en/modules/bme280.md @@ -5,7 +5,10 @@ This module provides a simple interface to [BME280/BMP280 temperature/air presssure/humidity sensors](http://www.bosch-sensortec.com/bst/products/all_products/bme280) (Bosch Sensortec). -Note that you must call [`setup()`](#bme280setup) before you can start reading values! +!!! caution + + Note that you must call [`setup()`](#bme280setup) before you can start reading values! Furthermore, there has to be a variable delay between some tens to hundreds of milliseconds between `setup()` and reading measurements. Instead of using a fixed delay you might also poll the sensor until data is delivered e.g. `humi()` not returning `nil` anymore. + ## bme280.altitude() @@ -215,6 +218,7 @@ print(string.format("altitude=%s%d.%02d", curAltsgn<0 and "-" or "", curAlt/100, ``` Or simpler and more efficient + ```lua alt=320 -- altitude of the measurement place