move turnontime back to on and off context
live view of pressure and watersensor
This commit is contained in:
11
src/main.cpp
11
src/main.cpp
@@ -39,7 +39,8 @@ void pumpeSchalten(bool on) {
|
||||
|
||||
if (allow && !error) {
|
||||
if (on) {
|
||||
pumpendauer.once(maxpumpdauer + 1, []() { //erlaube keine einschaltung von mehr als 60 sek
|
||||
pumpendauer.once(maxpumpdauer + 1, []() {
|
||||
//erlaube keine einschaltung von mehr als 60 sek
|
||||
if (millis() - turnontime >= maxpumpdauer * 1000 && turnontime != -1) {
|
||||
//error zu lange
|
||||
Serial.println("\n\npumpe lief mehr als 10 Minuten durchgaengig");
|
||||
@@ -47,11 +48,13 @@ void pumpeSchalten(bool on) {
|
||||
error = true;
|
||||
}
|
||||
});
|
||||
|
||||
turnontime = millis();
|
||||
}else{
|
||||
} else {
|
||||
mang.setPumpDuration(millis() - turnontime);
|
||||
}
|
||||
|
||||
// save pump start time
|
||||
turnontime = millis();
|
||||
|
||||
digitalWrite(SchuetzPin, on);
|
||||
Serial.println("[Erfolg] pumpe wird geschalten");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user