-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDigital.h
61 lines (54 loc) · 1.13 KB
/
Digital.h
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
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef _DIGITAL
#define _DIGITAL
#include <time.h>
class EZB;
class DigitalClass{
public:
enum DigitalPortEnum{
D0 = 0,
D1 = 1,
D2 = 2,
D3 = 3,
D4 = 4,
D5 = 5,
D6 = 6,
D7 = 7,
D8 = 8,
D9 = 9,
D10 = 10,
D11 = 11,
D12 = 12,
D13 = 13,
D14 = 14,
D15 = 15,
D16 = 16,
D17 = 17,
D18 = 18,
D19 = 19,
};
int MinPoolTimeMS;
DigitalClass(EZB* ezb);
bool GetDigitalPort(DigitalPortEnum digitalPort);
//
// Summary:
// Query the status of a digital port as an Integer (0 false, 1 true)
int GetDigitalPortAsInt(DigitalPortEnum digitalPort);
//
// Summary:
// Does not query the EZ-B Controller. This returns the status of the port after
// you had SetDigitalPort().
bool GetLastDigitalPortSet(DigitalPortEnum digitalPort);
//
// Summary:
// Set the status of a digital port. TRUE will output +5, FALSE will short to
// GND
//
// Returns:
// True if successful
void SetDigitalPort(DigitalPortEnum digitalPort, bool status);
private:
EZB* m_ezb;
unsigned long m_last_request[20];
bool m_last_value[20];
};
#endif