mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-28 23:22:19 +03:00
recovery
This commit is contained in:
46
include/items/vSensorPzem.h
Normal file
46
include/items/vSensorPzem.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifdef EnableSensorPzem
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Global.h"
|
||||
#include "PZEMSensor.h"
|
||||
#include "SoftUART.h"
|
||||
|
||||
class SensorPzem;
|
||||
|
||||
typedef std::vector<SensorPzem> MySensorPzemVector;
|
||||
|
||||
struct paramsPzem {
|
||||
String key;
|
||||
String addr;
|
||||
unsigned long interval;
|
||||
float c;
|
||||
float k;
|
||||
};
|
||||
|
||||
class SensorPzem {
|
||||
public:
|
||||
SensorPzem(const paramsPzem& paramsV, const paramsPzem& paramsA, const paramsPzem& paramsWatt, const paramsPzem& paramsWattHrs, const paramsPzem& paramsHz);
|
||||
~SensorPzem();
|
||||
|
||||
void loop();
|
||||
|
||||
private:
|
||||
void read();
|
||||
|
||||
paramsPzem _paramsV;
|
||||
paramsPzem _paramsA;
|
||||
paramsPzem _paramsWatt;
|
||||
paramsPzem _paramsWattHrs;
|
||||
paramsPzem _paramsHz;
|
||||
|
||||
PZEMSensor* pzem;
|
||||
|
||||
unsigned long prevMillis;
|
||||
unsigned long difference;
|
||||
};
|
||||
|
||||
extern MySensorPzemVector* mySensorPzem;
|
||||
|
||||
extern void pzemSensor();
|
||||
#endif
|
||||
Reference in New Issue
Block a user