summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-02-14 20:23:30 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-02-14 20:23:30 +0100
commit1f1d47d6c867ae3fdab9b84f3f9a691d645fd413 (patch)
treeda97c0081f9acc6bb7d0f28d3e2638be7d5819cf /src
parentec1cc59aea20537a19a8091f541a695487ec5ad2 (diff)
bme680-max44009-logger: switch to bme680 float api
Diffstat (limited to 'src')
-rw-r--r--src/app/bme680-max44009-logger/Makefile.inc2
-rw-r--r--src/app/bme680-max44009-logger/main.cc7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/app/bme680-max44009-logger/Makefile.inc b/src/app/bme680-max44009-logger/Makefile.inc
index 5b3e8bb..8a7f5d3 100644
--- a/src/app/bme680-max44009-logger/Makefile.inc
+++ b/src/app/bme680-max44009-logger/Makefile.inc
@@ -9,3 +9,5 @@ ifdef app
override arch_drivers += ,i2c
override drivers += ,bme680,max44009
endif
+
+COMMON_FLAGS += -DBME680_FLOAT_POINT_COMPENSATION
diff --git a/src/app/bme680-max44009-logger/main.cc b/src/app/bme680-max44009-logger/main.cc
index ae11869..5ea1cee 100644
--- a/src/app/bme680-max44009-logger/main.cc
+++ b/src/app/bme680-max44009-logger/main.cc
@@ -95,9 +95,10 @@ void loop(void)
bme680_status = bme680.getSensorData(&data);
}
if (bme680_status == 0) {
- kout << "BME680 temperature: " << (float)data.temperature / 100 << " degC" << endl;
- kout << "BME680 humidity: " << (float)data.humidity / 1000 << " %" << endl;
- kout << "BME680 pressure: " << (float)data.pressure / 100 << " hPa" << endl;
+ bme680.amb_temp = data.temperature;
+ kout << "BME680 temperature: " << data.temperature << " degC" << endl;
+ kout << "BME680 humidity: " << data.humidity << " %" << endl;
+ kout << "BME680 pressure: " << data.pressure / 100 << " hPa" << endl;
kout << "BME680 gas resistance: " << data.gas_resistance << endl;
} else {
kout << "# BME680 error " << bme680_status << endl;