diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-08-07 17:31:59 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-08-07 17:31:59 +0200 |
commit | 178835c160940772341615dab7a239c45a875807 (patch) | |
tree | c732f59d48c41453cd8c28603ee61f3365fac773 /src/app/i2cdetect | |
parent | 8579b2a1023211c86cb1221eb2b44b9221034478 (diff) |
Add AM2320 driver
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; |