mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 22:52:19 +03:00
34 lines
594 B
C
34 lines
594 B
C
|
|
#ifdef EnableCountDown
|
||
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <Arduino.h>
|
||
|
|
|
||
|
|
#include "Global.h"
|
||
|
|
|
||
|
|
class CountDownClass;
|
||
|
|
|
||
|
|
typedef std::vector<CountDownClass> MyCountDownVector;
|
||
|
|
|
||
|
|
class CountDownClass {
|
||
|
|
public:
|
||
|
|
CountDownClass(String key);
|
||
|
|
~CountDownClass();
|
||
|
|
|
||
|
|
void loop();
|
||
|
|
void execute(unsigned int countDownPeriod);
|
||
|
|
|
||
|
|
private:
|
||
|
|
unsigned long _countDownPeriod = 0;
|
||
|
|
bool _start = false;
|
||
|
|
String _key;
|
||
|
|
|
||
|
|
unsigned long prevMillis;
|
||
|
|
unsigned long difference;
|
||
|
|
int sec;
|
||
|
|
};
|
||
|
|
|
||
|
|
extern MyCountDownVector* myCountDown;
|
||
|
|
|
||
|
|
extern void countDown();
|
||
|
|
extern void countDownExecute();
|
||
|
|
#endif
|