Improve performance of motor detect switch
by using the right variable WHOOPS
This commit is contained in:
parent
f1e592ba1e
commit
4fdd7f3fd6
|
@ -63,6 +63,7 @@ void getOnline(){
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
if(WiFi.status() != WL_CONNECTED) getOnline();
|
if(WiFi.status() != WL_CONNECTED) getOnline();
|
||||||
|
if (!mqttclient.connected()) mqttclient.connect(clientName);
|
||||||
feedButtonDebounced.update();
|
feedButtonDebounced.update();
|
||||||
motorSwitchDebounced.update();
|
motorSwitchDebounced.update();
|
||||||
mqttclient.loop(); //
|
mqttclient.loop(); //
|
||||||
|
@ -87,7 +88,7 @@ void loop() {
|
||||||
lastAnnounced = 1;
|
lastAnnounced = 1;
|
||||||
}
|
}
|
||||||
digitalWrite(motorPin, HIGH);
|
digitalWrite(motorPin, HIGH);
|
||||||
if (feedButtonDebounced.fell()){
|
if (motorSwitchDebounced.fell()){
|
||||||
digitalWrite(motorPin, LOW);
|
digitalWrite(motorPin, LOW);
|
||||||
botMode = 0;
|
botMode = 0;
|
||||||
modeStartTime = 0;
|
modeStartTime = 0;
|
||||||
|
|
Loading…
Reference in New Issue