mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
40 lines
661 B
C++
40 lines
661 B
C++
#pragma once
|
|
#include <Arduino.h>
|
|
#include <DHTesp.h>
|
|
|
|
#include "Global.h"
|
|
#include "GyverFilters.h"
|
|
|
|
class SensorDht;
|
|
|
|
typedef std::vector<SensorDht> MySensorDhtVector;
|
|
|
|
struct paramsDht {
|
|
String type;
|
|
String key;
|
|
unsigned long interval;
|
|
unsigned int pin;
|
|
float c;
|
|
};
|
|
|
|
class SensorDht {
|
|
public:
|
|
SensorDht(const paramsDht& paramsTmp, const paramsDht& paramsHum);
|
|
~SensorDht();
|
|
|
|
DHTesp* dht;
|
|
|
|
void loop();
|
|
void readTmpHum();
|
|
|
|
private:
|
|
paramsDht _paramsTmp;
|
|
paramsDht _paramsHum;
|
|
|
|
unsigned long prevMillis;
|
|
unsigned long difference;
|
|
};
|
|
|
|
extern MySensorDhtVector* mySensorDht;
|
|
|
|
extern void dhtSensor(); |