-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimedTask.h
More file actions
49 lines (36 loc) · 879 Bytes
/
TimedTask.h
File metadata and controls
49 lines (36 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* TimedTask,h
*
* Created by Danilo Queiroz Barbosa, June 18, 2017.
* Member of electronicdrops.com
*
*
* Header of the class TimedTask
* A Simple way to use concurrent tasks.
*
*/
#ifndef TIMEDTASK_H
#define TIMEDTASK_H
#include "Arduino.h"
class TimedTask {
private:
long _iterations;
boolean _active;
boolean _check_iterations;
unsigned long _interval;
unsigned long _previous_run;
void (*_function)();
void check_iterations();
public:
TimedTask(void (*func)(), unsigned long interval_);
TimedTask(void (*func)(), unsigned long interval_, int start);
void run();
void disable_iterations();
boolean active();
boolean active(boolean act);
unsigned long interval();
unsigned long interval(unsigned long interval_);
long iterations();
long iterations(long iter);
};
#endif