diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2019-10-18 10:38:48 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2019-10-18 10:38:48 +0200 |
commit | e391c1bc244838bb050ade946e709f671cd9cf94 (patch) | |
tree | f3b5e0260f95f886f54be213098f3362b7f8c815 /src/app/i2cdetect | |
parent | 8e0cde61737f46ba492768d86c54cff998da07a1 (diff) |
Add preliminary version of HDC1080 driver (not working reliably yet)
Diffstat (limited to 'src/app/i2cdetect')
-rw-r--r-- | src/app/i2cdetect/main.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/app/i2cdetect/main.cc b/src/app/i2cdetect/main.cc index acf5ef1..e74ce5b 100644 --- a/src/app/i2cdetect/main.cc +++ b/src/app/i2cdetect/main.cc @@ -25,6 +25,9 @@ #ifdef DRIVER_MAX44009 #include "driver/max44009.h" #endif +#ifdef DRIVER_HDC1080 +#include "driver/hdc1080.h" +#endif #ifdef DRIVER_MMSIMPLE #include "driver/mmsimple.h" #endif @@ -81,6 +84,10 @@ void loop(void) #ifdef DRIVER_CCS811 kout << "CCS811 status is " << ccs811.check() << endl; #endif +#ifdef DRIVER_HDC1080 + kout << "HDC1080 temperature " << hdc1080.getTemp() << " degC" << endl; + kout << "HDC1080 humidity " << hdc1080.getRH() << " %H" << endl; +#endif #ifdef DRIVER_MAX44009 kout.printf_float(max44009.getLux()); kout << endl; @@ -118,6 +125,12 @@ int main(void) #ifdef DRIVER_CCS811 ccs811.init(); #endif +#ifdef DRIVER_HDC1080 + hdc1080.init(); + if (hdc1080.getManufacturerID() != 0x5449) { + kout << "[!] invalid HDC1080 manufacturer ID: " << hex << hdc1080.getManufacturerID() << endl; + } +#endif for (unsigned char i = 0; i < sizeof(i2c_status)/sizeof(unsigned int); i++) { i2c_status[i] = 0; |