You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constint MOVE_TIMEOUT_DELTA = 4000; // time in milliseconds for the panels to stop moving after having received no command
69
69
70
+
// Whether automatically requesting angles and auto mode which uses them, are enabled.
71
+
const boolean ENABLE_AUTO = false;
72
+
70
73
71
74
voidsetup () {
72
75
//the serial shouldn't be used in final code, but this is always in development...
@@ -75,7 +78,9 @@ void setup () {
75
78
setPinModes();
76
79
setupEthernet();
77
80
setupNTP();
78
-
setupNAS();
81
+
if (ENABLE_AUTO) {
82
+
setupNAS();
83
+
}
79
84
setupPanels();
80
85
}
81
86
@@ -84,16 +89,22 @@ void loop () {
84
89
ether.packetLoop(ether.packetReceive());
85
90
receiveHttpRequests(); //be responsive as a webserver
86
91
checkMovingTimeout();
87
-
if (responseReceived && (EmergencyState == "") ) { // a check to make sure we don't request angles again before we received the ones we already had requested
88
-
if (tableIndex+1 >= TABLE_LENGTH) { //if we are at the end
89
-
requestNewTable();
90
-
} elseif (autoMode && dates[tableIndex+1]<now()) { //if time walked into next part
91
-
Serial.println(F("Advancing to next angle"));
92
-
tableIndex++;
93
-
Serial.println(angles[tableIndex]);
94
-
setSolarPanel(angles[tableIndex]);
92
+
93
+
if (ENABLE_AUTO) {
94
+
95
+
if (responseReceived && (EmergencyState == "") ) { // a check to make sure we don't request angles again before we received the ones we already had requested
96
+
if (tableIndex+1 >= TABLE_LENGTH) { //if we are at the end
97
+
requestNewTable();
98
+
} elseif (autoMode && dates[tableIndex+1]<now()) { //if time walked into next part
0 commit comments