From 178835c160940772341615dab7a239c45a875807 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 7 Aug 2018 17:31:59 +0200 Subject: Add AM2320 driver --- src/app/i2cdetect/main.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/app') diff --git a/src/app/i2cdetect/main.cc b/src/app/i2cdetect/main.cc index 141c65a..5094fd5 100644 --- a/src/app/i2cdetect/main.cc +++ b/src/app/i2cdetect/main.cc @@ -9,6 +9,9 @@ #ifdef DRIVER_LM75 #include "driver/lm75.h" #endif +#ifdef DRIVER_AM2320 +#include "driver/am2320.h" +#endif #ifdef DRIVER_MAX44009 #include "driver/max44009.h" #endif @@ -22,6 +25,17 @@ void loop(void) kout.printf_float(lm75.getTemp()); kout << endl; #endif +#ifdef DRIVER_AM2320 + am2320.read(); + if (am2320.getStatus() == 0) { + kout.printf_float(am2320.getTemp()); + kout << " degC @ "; + kout.printf_float(am2320.getHumidity()); + kout << " rel%" << endl; + } else { + kout << "AM2320 error " << dec << am2320.getStatus() << endl; + } +#endif #ifdef DRIVER_MAX44009 kout.printf_float(max44009.getLux()); kout << endl; -- cgit v1.2.3