mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
переписан dht
This commit is contained in:
63
include/items/vSensorDht.h
Normal file
63
include/items/vSensorDht.h
Normal 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();
|
||||
Reference in New Issue
Block a user