correct time set and get

This commit is contained in:
2020-06-20 15:10:35 +02:00
parent 387910d37f
commit a0d42847c9
3 changed files with 20 additions and 19 deletions

View File

@@ -15,7 +15,6 @@ static const uint8_t DruckSensorPin = 12;
static const uint8_t SchuetzPin = 13;
/** time config */
static int abschaltzeit = 7200; //sek
static const int maxpumpdauer = 600; //sek
// ticker fuer kein-wasser abschaltung
@@ -77,7 +76,7 @@ ICACHE_RAM_ATTR void DruckschalterInt() {
}
}
int i = abschaltzeit; //todo better
int i = mang.getWaitTime(); //todo better
void WasserSensorCheck() {
if (digitalRead(WasserSensorPin) == LOW) {
Serial.println("Wasser Sensor AUS");
@@ -91,7 +90,7 @@ void WasserSensorCheck() {
status.detach();
i = abschaltzeit;
i = mang.getWaitTime();
status.attach(5, []() {
i -= 5;
Serial.print("noch ");
@@ -144,13 +143,9 @@ void setup() {
//allow = digitalRead(WasserSensorPin);
allow = true;
int value = 0;
EEPROM.begin(4096); // init the eeprom
EEPROM.get(0, value);
EEPROM.end(); // stop the eeprom communication
int value = mang.getWaitTime();
Serial.print("read value from eeprom: ");
Serial.println(value);
abschaltzeit = value;
WasserSensorCheck();
DruckschalterInt();