webserver where to set the pump timeout

This commit is contained in:
2020-06-20 12:12:27 +02:00
parent 1ba2aad7e7
commit 387910d37f
3 changed files with 110 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
#include <Arduino.h>
#include <Ticker.h>
#include <EEPROM.h>
#include "WifiManager.h"
@@ -14,7 +15,7 @@ static const uint8_t DruckSensorPin = 12;
static const uint8_t SchuetzPin = 13;
/** time config */
static const int abschaltzeit = 7200; //sek
static int abschaltzeit = 7200; //sek
static const int maxpumpdauer = 600; //sek
// ticker fuer kein-wasser abschaltung
@@ -23,6 +24,8 @@ Ticker status;
//pumpendauer maximum ticker
Ticker pumpendauer;
WifiManager mang;
int turnontime = -1;
void pumpeSchalten(bool on) {
@@ -140,6 +143,15 @@ void setup() {
delay(1000);
//allow = digitalRead(WasserSensorPin);
allow = true;
int value = 0;
EEPROM.begin(4096); // init the eeprom
EEPROM.get(0, value);
EEPROM.end(); // stop the eeprom communication
Serial.print("read value from eeprom: ");
Serial.println(value);
abschaltzeit = value;
WasserSensorCheck();
DruckschalterInt();
@@ -152,11 +164,11 @@ void setup() {
Serial.println("startup sequence complete!\n");
digitalWrite(LED_BUILTIN, HIGH);
WifiManager mang = WifiManager();
mang.init();
}
void loop() {
mang.holdAlive();
}