summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-02-14 21:42:26 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-02-14 21:43:32 +0100
commitcf97c18554b9aa88202b9d2463ee08cafd1252b0 (patch)
treed29c3004f678df32f4e0bc8ba97521cceac76445 /src/app
parent1f1d47d6c867ae3fdab9b84f3f9a691d645fd413 (diff)
add initialization and readout to CCS811 driver
Diffstat (limited to 'src/app')
-rw-r--r--src/app/i2cdetect/main.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/app/i2cdetect/main.cc b/src/app/i2cdetect/main.cc
index 4d6ebe9..92c812c 100644
--- a/src/app/i2cdetect/main.cc
+++ b/src/app/i2cdetect/main.cc
@@ -125,7 +125,13 @@ void loop(void)
kout << "BME680 gas resistance " << data.gas_resistance << endl;
#endif
#ifdef DRIVER_CCS811
- kout << "CCS811 status is " << ccs811.check() << endl;
+ ccs811.read();
+ kout << "CCS811 eCO₂ : " << ccs811.eco2 << " ppm" << endl;
+ kout << "CCS811 tVOC : " << ccs811.tvoc << " ppb" << endl;
+ kout << bin;
+ kout << "CCS811 status: " << ccs811.status << endl;
+ kout << "CCS811 error: " << ccs811.error_id << endl;
+ kout << dec;
#endif
#ifdef DRIVER_HDC1080
/*
@@ -186,7 +192,17 @@ int main(void)
kout << "I2C setup OK" << endl;
#ifdef DRIVER_CCS811
+ kout << hex;
+ kout << "CCS811 HWID: " << ccs811.getManufacturerID() << endl;
+ arch.delay_ms(65);
+ kout << "CCS811 status: " << ccs811.getStatus() << endl;
+ arch.delay_ms(65);
ccs811.init();
+ arch.delay_ms(65);
+ kout << "CCS811 status: " << ccs811.getStatus() << endl;
+ kout << dec;
+ ccs811.setMode(1);
+ //arch.delay_ms(50);
#endif
#ifdef DRIVER_HDC1080
hdc1080.init();