diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-12-27 14:54:01 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-12-27 14:54:01 +0100 |
commit | 53de8b4b7ae2c99d16ebe43876368c2d51a791e2 (patch) | |
tree | 4b09775a80d4d56d1e40d19d38ed3a7557295ba6 /src/app | |
parent | 095e405c93ccdb6f8a358697f68a394ce1654999 (diff) |
add VEML6075 driver
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/datalogger/main.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/app/datalogger/main.cc b/src/app/datalogger/main.cc index 6cdba9e..9083825 100644 --- a/src/app/datalogger/main.cc +++ b/src/app/datalogger/main.cc @@ -54,6 +54,9 @@ #ifdef CONFIG_driver_scd4x #include "driver/scd4x.h" #endif +#ifdef CONFIG_driver_veml6075 +#include "driver/veml6075.h" +#endif void loop(void) { @@ -195,6 +198,17 @@ void loop(void) kout.printf_float((100.0 * scd4x.rawHumidity) / 65536); kout << " %" << endl; #endif + +#ifdef CONFIG_driver_veml6075 + float uva, uvb; + if (veml6075.readUV(&uva, &uvb)) { + kout << "VEML6075 UVA: " << uva << " µW / cm²" << endl; + kout << "VEML6075 UVB: " << uvb << " µW / cm²" << endl; + } + if (veml6075.readUVI(&uva, &uvb)) { + kout << "VEML6075 UV Index: " << (uva + uvb)/2 << endl; + } +#endif } int main(void) @@ -299,6 +313,10 @@ int main(void) scd4x.start(); #endif +#ifdef CONFIG_driver_veml6075 + veml6075.init(); +#endif + arch.idle_loop(); return 0; |