summaryrefslogtreecommitdiff
path: root/src/app/datalogger
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-02-25 23:09:34 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-02-25 23:09:34 +0100
commit9a3d3bcc93f8cefea74af2a86b5834a57738e2c3 (patch)
tree6684318cfae0f6761b657a263db96472e78ec8d6 /src/app/datalogger
parent4e70dc99f2fe61235c7e23739f91e3f7e2fff837 (diff)
add simple TSL2591 illuminance / IR sensor driver
Diffstat (limited to 'src/app/datalogger')
-rw-r--r--src/app/datalogger/main.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/app/datalogger/main.cc b/src/app/datalogger/main.cc
index 8312367..8740035 100644
--- a/src/app/datalogger/main.cc
+++ b/src/app/datalogger/main.cc
@@ -42,6 +42,9 @@
#ifdef DRIVER_MPU9250
#include "driver/mpu9250.h"
#endif
+#ifdef DRIVER_TSL2591
+#include "driver/tsl2591.h"
+#endif
void loop(void)
{
@@ -127,6 +130,12 @@ void loop(void)
kout.printf_float(max44009.getLux());
kout << endl;
#endif
+
+#ifdef DRIVER_TSL2591
+ tsl2591.read();
+ kout << dec << "TSL2591 CH0: " << tsl2591.ch0 << " / CH1: " << tsl2591.ch1;
+ kout << hex << " (status: 0x" << tsl2591.getStatus() << ")" << endl;
+#endif
}
int main(void)
@@ -211,6 +220,10 @@ int main(void)
mpu9250.init();
#endif
+#ifdef DRIVER_TSL2591
+ tsl2591.init();
+#endif
+
arch.idle_loop();
return 0;