mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
Добавляем файлы для нового сенсора SHT20
This commit is contained in:
40
include/items/vSensorSHT20.h
Normal file
40
include/items/vSensorSHT20.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifdef EnableSensorSht20
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
#include "Wire.h"
|
||||
#include "SHT2x.h"
|
||||
|
||||
#include "Global.h"
|
||||
|
||||
extern SHT2x* sht;
|
||||
|
||||
class SensorSht20;
|
||||
|
||||
typedef std::vector<SensorSht20> MySensorSht20Vector;
|
||||
|
||||
struct paramsSht {
|
||||
String key;
|
||||
unsigned long interval;
|
||||
float c;
|
||||
};
|
||||
|
||||
class SensorSht20 {
|
||||
public:
|
||||
SensorSht20(const paramsSht& paramsTmp, const paramsSht& paramsHum);
|
||||
~SensorSht20();
|
||||
|
||||
void loop();
|
||||
void read();
|
||||
|
||||
private:
|
||||
paramsSht _paramsTmp;
|
||||
paramsSht _paramsHum;
|
||||
|
||||
unsigned long prevMillis;
|
||||
unsigned long difference;
|
||||
};
|
||||
|
||||
extern MySensorSht20Vector* mySensorSht20;
|
||||
|
||||
extern void sht20Sensor();
|
||||
#endif
|
||||
Reference in New Issue
Block a user