diff options
Diffstat (limited to 'platformio/temphum/src/temphum.h')
-rw-r--r-- | platformio/temphum/src/temphum.h | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/platformio/temphum/src/temphum.h b/platformio/temphum/src/temphum.h deleted file mode 100644 index 3d8f373..0000000 --- a/platformio/temphum/src/temphum.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include <Wire.h> - -namespace homekit::temphum { - -struct SensorData { - double temp = 0; // celsius - double rh = 0; // relative humidity percentage -}; - - -class BaseSensor { -protected: - int dev_addr; -public: - explicit BaseSensor(int dev) : dev_addr(dev) {} - void setup() const; - void writeCommand(int reg) const; - virtual SensorData read() = 0; -}; - - -class Si7021 : public BaseSensor { -public: - SensorData read() override; - Si7021() : BaseSensor(0x40) {} -}; - - -class DHT12 : public BaseSensor { -public: - SensorData read() override; - DHT12() : BaseSensor(0x5c) {} -}; - -}
\ No newline at end of file |