переписан dht

This commit is contained in:
Dmitry Borisenko
2020-12-21 01:46:11 +01:00
parent c5772f8451
commit d9672d17b0
14 changed files with 380 additions and 211 deletions

View File

@@ -0,0 +1,63 @@
#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 tmpParams {
unsigned long currentMillis;
unsigned long prevMillis;
unsigned long difference;
unsigned long interval;
String key;
unsigned int pin;
int map1;
int map2;
int map3;
int map4;
float c;
};
struct humParams {
unsigned long currentMillis;
unsigned long prevMillis;
unsigned long difference;
unsigned long interval;
String key;
unsigned int pin;
int map1;
int map2;
int map3;
int map4;
float c;
};
class SensorDht {
public:
SensorDht();
~SensorDht();
void loopTmp();
void loopHum();
void readTmp();
void readHum();
void tmpInit(const tmpParams& tmpSet);
void humInit(const humParams& humSet);
private:
tmpParams _tmpSet;
humParams _humSet;
};
extern MySensorDhtVector* mySensorDht;
extern void dhtTmp();
extern void dhtHum();