-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGarageHardware.h
106 lines (94 loc) · 2.63 KB
/
GarageHardware.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#ifndef __GARAGE_HARDWARE__
#define __GARAGE_HARDWARE__
#include"Arduino.h"
/**
* Setup the door hardware (all I/O should be configured here)
*
* This routine should be called only once from setup()
*/
void setupHardware();
/**
* Return true if the door open/close button is pressed
*
* Note: this is directly based on hardware. No debouncing or
* other processing is performed.
*
* return true if buttons is currently pressed, false otherwise
*/
boolean isButtonPressed();
/**
* Return true if the door is fully closed
*
* Note: This is directly based on hardware. No debouncing or
* other processing is performed.
*
* return true if the door is completely closed, false otherwise
*/
boolean isDoorFullyClosed();
/**
* Return true if the door has experienced a fault
*
* Note: This is directly based on hardware. No debouncing or
* other processing is performed.
*
* return true if the door is has experienced a fault
*/
boolean isFaultActive();
/**
* Return true if the door is fully open
*
* Note: This is directly based on hardware. No debouncing or
* other processing is performed.
*
* return true if the door is completely open, false otherwise
*/
boolean isDoorFullyOpen();
/**
* This function will start the motor moving in a direction that opens the door.
*
* Note: This is a non-blocking function. It will return immediately
* and the motor will continue to opperate until stopped or reversed.
*
* return void
*/
void startMotorOpening();
/**
* This function will start the motor moving in a direction closes the door.
*
* Note: This is a non-blocking function. It will return immediately
* and the motor will continue to opperate until stopped or reversed.
*
* return void
*/
void startMotorClosing();
/**
* This function will stop all motor movement.
*
* Note: This is a non-blocking function. It will return immediately.
*
* return void
*/
void stopMotor();
/**
* This function will control the state of the light on the opener.
*
* Parameter: on: true indicates the light should enter the "on" state;
* false indicates the light should enter the "off" state
*
* Note: This is a non-blocking function. It will return immediately.
*
* return void
*/
void setLight(boolean on);
/**
* This function will control the state of the light on the opener.
*
* Parameter: cycle (0-100). 0 indicates completely Off, 100 indicates completely on.
* intermediate values are the duty cycle (as a percent)
*
* Note: This is a non-blocking function. It will return immediately.
*
* return void
*/
void setLightPWM(int cyclePct);
#endif