-
Notifications
You must be signed in to change notification settings - Fork 0
/
Z_Main.ino
51 lines (39 loc) · 1.03 KB
/
Z_Main.ino
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
// The following 4 variables dont have any use. But just given here in case you would like to use them.
Button *fan;
Button *lights;
Button *bulb;
Button *extra;
/**
* Onn Device Start / Reset
*/
void setup() {
Serial.begin(115200);
// Init EEPROM
initEEPROM();
// Init Rain Maker
initRain();
// Init Buttons
initButtons();
// Begin Rain Maker
letItRain();
// Begin Provisioning
initProv();
}
/**
* Do this forever
*/
void loop() {
// Keep Reading reset button
readReset();
}
/**
* Initialize the buttons
* ----------------------
* TODO: Move to Array
*/
void initButtons() {
fan = new Button(DEVICE_FAN, FAN_RELAY_PIN, FAN_EEPROM_ADDRESS, ESP_RMAKER_DEVICE_FAN);
lights = new Button(DEVICE_LIGHTS, LIGHTS_RELAY_PIN, LIGHTS_EEPROM_ADDRESS, ESP_RMAKER_DEVICE_LIGHTBULB);
bulb = new Button(DEVICE_DOORLIGHT, DOORLIGHT_RELAY_PIN, DOORLIGHT_EEPROM_ADDRESS, ESP_RMAKER_DEVICE_LIGHTBULB);
extra = new Button(DEVICE_CHANDELIER, CHANDELIER_RELAY_PIN, CHANDELIER_EEPROM_ADDRESS, ESP_RMAKER_DEVICE_SWITCH);
}