mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-28 15:12:19 +03:00
add logging class (not working version)
This commit is contained in:
25
src/items/LoggingClass.cpp
Normal file
25
src/items/LoggingClass.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "items/LoggingClass.h"
|
||||
|
||||
LoggingClass::LoggingClass(unsigned long period, unsigned int maxPoints, String key) {
|
||||
_period = period;
|
||||
_maxPoints = maxPoints;
|
||||
_key = key;
|
||||
}
|
||||
|
||||
LoggingClass::~LoggingClass() {}
|
||||
|
||||
void LoggingClass::loop() {
|
||||
currentMillis = millis();
|
||||
difference = currentMillis - prevMillis;
|
||||
if (difference >= _period) {
|
||||
prevMillis = millis();
|
||||
writeDate();
|
||||
}
|
||||
}
|
||||
|
||||
void LoggingClass::writeDate() {
|
||||
SerialPrint("I", "Logging", _key);
|
||||
}
|
||||
|
||||
std::vector<LoggingClass*> myLogging;
|
||||
//LoggingClass* myLogging;
|
||||
Reference in New Issue
Block a user