From a155928f199ac0ffaae14cc02b448979094aa6ae Mon Sep 17 00:00:00 2001 From: sheinz Date: Fri, 8 Jul 2016 12:49:51 +0300 Subject: [PATCH] Update README.md --- extras/bmp280/README.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/extras/bmp280/README.md b/extras/bmp280/README.md index ad9ff87..64ffc1c 100644 --- a/extras/bmp280/README.md +++ b/extras/bmp280/README.md @@ -57,12 +57,14 @@ bmp280_init_default_params(¶ms); params.mode = BMP280_MODE_FORCED; bmp280_init(¶ms, scl_pin, sda_pin); -bmp280_force_measurement(); +while (1) { + bmp280_force_measurement(); + while (bmp280_is_measuring()) {}; // wait for measurement to complete -while (bmp280_is_measuring()) {}; // wait for measurement to complete - -bmp280_read(&temperature, &pressure); -printf("Pressure: %.2f Pa, Temperature: %.2f C\n", pressure, temperature); + bmp280_read(&temperature, &pressure); + printf("Pressure: %.2f Pa, Temperature: %.2f C\n", pressure, temperature); + vTaskDelay(1000 / portTICK_RATE_MS); +} ``` ### Normal mode @@ -74,12 +76,15 @@ float pressure, temperature; bmp280_init_default_params(¶ms); bmp280_init(¶ms, scl_pin, sda_pin); -bmp280_read(&temperature, &pressure); -printf("Pressure: %.2f Pa, Temperature: %.2f C\n", pressure, temperature); - +while (1) { + bmp280_read(&temperature, &pressure); + printf("Pressure: %.2f Pa, Temperature: %.2f C\n", pressure, temperature); + vTaskDelay(1000 / portTICK_RATE_MS); +} ``` ## License The driver is released under MIT license. + Copyright (c) 2016 sheinz (https://github.com/sheinz)