finally a working modularized version

This commit is contained in:
2016-04-10 00:20:50 +02:00
parent 73395170ac
commit 52c4648c02
3 changed files with 5 additions and 8 deletions

View File

@ -7,7 +7,7 @@
class DeviceDht : public Device {
public:
inline DeviceDht(byte dhtPin, byte dhtType) {
inline DeviceDht(byte dhtPin, byte dhtType):dht(dhtPin, dhtType) {
pin = dhtPin;
type = dhtType;
}
@ -17,9 +17,7 @@ class DeviceDht : public Device {
private:
byte pin;
byte type;
// TODO configuration via constructor doesn't work yet
//DHT dht{pin, type};
DHT dht{D4, DHT22};
DHT dht;
const int INTERVAL_DHT = 60;
unsigned long lastSentDHT = 0;
float humidity, temperature; // raw values from the sensor