-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaster.h
80 lines (52 loc) · 1.98 KB
/
master.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef master
#define master
#include "Arduino.h"
/************** Start Master Class Definition ************/
class Master
{
/************** Start Public Functions ************/
public:
// initialize pins on the arduino
void pins(int dataPin, int latchPin, int clockPin);
// a function to update relayes status
void cycleSwitchRelay();
// a function to trun off all relayes
void resetRelayes();
// a function to turn on or off a relay by specifying its pin number
void turnOnOffRelay(int changePin, int onOff);
// a test function for shift register
void testShiftRegister();
/************** End Public Functions ************/
/************** Start Private and Protected Functions ************/
protected:
// constans variables used for remote input limits
static int _minParametersMaped;
static int _maxParametersMaped;
static int _mapedLowerBound;
static int _mapedUpperBound;
// changes the range of acceptable input from a specific button/dial/switch on the remote control
int changeRange(int x);
// defines a margin area where any input within that range wouldn't be acceptable
bool marginError(int postion , int marginError);
// turns on a pin
int pulseInPlus(int pin);
// checks the input value a switch
bool returnSwitchValue(int x);
// checks the input value of a dial
int DialValue(int value);
private:
// constans variables for the shift register system
static int _marginErrorNumber;
static int _shiftRegisterMaxValue;
static int _shiftRegisterCurrentValue;
static int _shiftRegisterOriginalValue;
//SR - shift register
int _SRDataPin;
int _SRLatchPin;
int _SRClockPin;
// main shift register driver function
void _shiftInBytes(int bytes);
/************** End Private and Protected Functions ************/
};
/************** End Master Class Definition ************/
#endif