Added overide controls

This commit is contained in:
mrcory
2020-03-01 22:37:19 -05:00
parent f77d8b6297
commit 345554f3fc
+20 -5
View File
@@ -74,12 +74,14 @@ int energyResetCounter;
//-------------------------------
bool relayOveride = false;
bool relayControl = false;
#include "config.h"
#include "timer.h"
#include "blynk.h"
#include "blynkFunc.h"
#include "function.h"
#include "blynkFunc.h"
@@ -136,9 +138,19 @@ bool relayOveride = false;
}
void loop() {
if (timer(2,2000)) {
if (timer(1000,2) == true) {
sendBlynk();
Serial.println(temp.cur);
}
if (isFirstRun == true) {
Blynk.virtualWrite(V53,temp.target);
Blynk.virtualWrite(V55,temp.offset);
Blynk.virtualWrite(V57,cooldownPeriod);
}
isFirstRun = false;
ArduinoOTA.handle();
Blynk.run();
@@ -146,9 +158,12 @@ void loop() {
if (!relayOveride) {
tempProcess();
} else {
if (relayControl) {
RelayOn();
} else {
RelayOff();
}
}
if (isFirstRun == true) {
isFirstRun = false;
}
}