-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPLCTimer.h
More file actions
43 lines (32 loc) · 794 Bytes
/
PLCTimer.h
File metadata and controls
43 lines (32 loc) · 794 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
// DEFINICION DE ESTRUCTURAS DE DATOS Y FUNCIONES DE PLC ADAPTADAS PARA ARDUINO
#ifndef PLCTimer_h
#define PLCTimer_h
#include "Arduino.h"
#define TEMP_CON 0
#define TEMP_DESCON 1
#define TEMP_CON_DESCON 2
#define PULSE 3
class PLCTimer
{
typedef void (PLCTimer::*ptrF)(void); // define the type of pointers to functions void (void)
public:
PLCTimer(uint8_t type);
// VARIABLES
volatile bool In;
volatile int Delay;
bool Reset; // manual reset
volatile bool OUT; // salida
volatile void Execute();
private:
uint8_t _Type;
volatile int _timer; // memory to keep counting the delay
volatile boolean _temporiza;
volatile boolean _In_ant;
ptrF Callback;
// FUNCTIONS
void TC(void);
void TD(void);
void TCD(void);
void _PULSE(void);
};
#endif