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