diff options
Diffstat (limited to 'src/app/i2cdetect')
-rw-r--r-- | src/app/i2cdetect/main.cc | 14 |
1 files changed, 14 insertions, 0 deletions
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; |