mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
in progress not working version!!!
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
#include <DHTesp.h>
|
||||
|
||||
#include "Global.h"
|
||||
#include "GyverFilters.h"
|
||||
|
||||
@@ -10,51 +11,30 @@ class SensorDht;
|
||||
|
||||
typedef std::vector<SensorDht> MySensorDhtVector;
|
||||
|
||||
struct tmpParams {
|
||||
unsigned long currentMillis;
|
||||
unsigned long prevMillis;
|
||||
unsigned long difference;
|
||||
unsigned long interval;
|
||||
struct params {
|
||||
String type;
|
||||
String value;
|
||||
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(const params& paramsTmp, const params& paramsHum);
|
||||
~SensorDht();
|
||||
|
||||
void loopTmp();
|
||||
void loopHum();
|
||||
|
||||
void readTmp();
|
||||
void readHum();
|
||||
|
||||
void tmpInit(const tmpParams& tmpSet);
|
||||
void humInit(const humParams& humSet);
|
||||
void loop();
|
||||
void readTmpHum();
|
||||
|
||||
private:
|
||||
tmpParams _tmpSet;
|
||||
humParams _humSet;
|
||||
params _paramsTmp;
|
||||
params _paramsHum;
|
||||
|
||||
unsigned long currentMillis;
|
||||
unsigned long prevMillis;
|
||||
unsigned long difference;
|
||||
};
|
||||
|
||||
extern MySensorDhtVector* mySensorDht;
|
||||
|
||||
Reference in New Issue
Block a user