Files
IoTManager/include/items/vSensorDht.h

40 lines
668 B
C
Raw Normal View History

2020-12-21 01:46:11 +01:00
#pragma once
#include <Arduino.h>
#include <DHTesp.h>
2020-12-22 12:38:05 +01:00
2020-12-21 01:46:11 +01:00
#include "Global.h"
#include "GyverFilters.h"
extern DHTesp* dht;
class SensorDht;
typedef std::vector<SensorDht> MySensorDhtVector;
struct paramsDht {
2020-12-22 12:38:05 +01:00
String type;
2020-12-21 01:46:11 +01:00
String key;
unsigned long interval;
unsigned int pin;
float c;
};
class SensorDht {
public:
SensorDht(const paramsDht& paramsTmp, const paramsDht& paramsHum);
2020-12-21 01:46:11 +01:00
~SensorDht();
2020-12-22 12:38:05 +01:00
void loop();
void readTmpHum();
2020-12-21 01:46:11 +01:00
private:
paramsDht _paramsTmp;
paramsDht _paramsHum;
2020-12-24 01:05:54 +01:00
2020-12-22 12:38:05 +01:00
unsigned long prevMillis;
unsigned long difference;
2020-12-21 01:46:11 +01:00
};
extern MySensorDhtVector* mySensorDht;
2020-12-24 01:41:15 +01:00
extern void dhtSensor();