-
Notifications
You must be signed in to change notification settings - Fork 0
/
CVSerialzilla.ino
36 lines (27 loc) · 1.03 KB
/
CVSerialzilla.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
#include "Functions.h"
#include "Honeywell.h"
void setup() {
Serial.begin(115200);
initializeWiFi("Connecting"); // Connect to Wifi
}
void loop() {
//make data
if(createDeviceArray()){
for(int i=0;i<numberOfRooms;i++){ //loop through each array
if(degreesSet[i] > currentDegrees[i]){ //check if a room needs to be heated
for(int j=0;j<numberOfRooms;j++){ //then loop and make sure others are on so heating flows
if(j!=i){ //make sure its not checking current one
if(degreesSet[j] <= currentDegrees[j] && currentDegrees[j] < deviceMaxTemps[j]){ //if its hotter in the room then needed this wont work so needs to be increased
if(setEvoHomeDeviceValue(deviceIDs[j],currentDegrees[j]+2)){
Serial.println("Room " + deviceNames[j] + " increased");
}
}
}
}
break; //then break the whole routine as it only needs to be done once.
}
}
Serial.println("done");
}
delay(60000);//check if needed once a minute
}