From 2951ecf7e375f15a1734106653088ae0317fbea1 Mon Sep 17 00:00:00 2001 From: murmeltier08 <44034211+murmeltier08@users.noreply.github.com> Date: Mon, 6 Jun 2022 09:39:16 +0200 Subject: [PATCH] fix trigger brewing --- src/brewvoid.h | 28 ++++++++++++++-------------- src/rancilio-pid.cpp | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/brewvoid.h b/src/brewvoid.h index 7a0de8e9d..25e2fadff 100644 --- a/src/brewvoid.h +++ b/src/brewvoid.h @@ -52,7 +52,7 @@ void checkbrewswitch() { } brewswitchTrigger = reading; - Serial.println(brewswitchTrigger); + // Serial.println(brewswitchTrigger); #endif // Digital Analog @@ -91,34 +91,34 @@ void checkbrewswitch() { Serial.println("brewswitchTriggerCase 20: Brew Trigger HIGH"); } - // Button one 1sec pushed + // Button more than one 1sec pushed if (brewswitchTrigger == HIGH && (brewswitchTriggermillis + 1000 <= millis())) { // DO something Serial.println("brewswitchTriggerCase 20: Manual Trigger - brewing"); - brewswitchTriggerCase = 30; + brewswitchTriggerCase = 31; digitalWrite(PINVALVE, relayON); digitalWrite(PINPUMP, relayON); } break; - case 30: + // Stop Brew trigger (one push) brewswitch == HIGH + if ((brewswitchTrigger == HIGH && brewswitch == HIGH) || (machinestate == 31) ) { + brewswitch = LOW; + brewswitchTriggerCase = 40; + brewswitchTriggermillis = millis(); + Serial.println("brewswitchTriggerCase 30: Brew Trigger LOW"); + } + break; + case 31: // Stop Manual brewing, button goes low: if (brewswitchTrigger == LOW && brewswitch == LOW) { brewswitchTriggerCase = 40; brewswitchTriggermillis = millis(); - Serial.println("brewswitchTriggerCase 30: Manual Trigger - brewing stop"); + Serial.println("brewswitchTriggerCase 31: Manual Trigger - brewing stop"); digitalWrite(PINVALVE, relayOFF); digitalWrite(PINPUMP, relayOFF); } - - // Stop Brew trigger brewswitch == HIGH - if (brewswitchTrigger == HIGH && brewswitch == HIGH) { - brewswitch = LOW; - brewswitchTriggerCase = 40; - brewswitchTriggermillis = millis(); - Serial.println("brewswitchTriggerCase 30: Brew Trigger LOW"); - } - break; + break; case 40: // wait 5 Sec until next brew, detection diff --git a/src/rancilio-pid.cpp b/src/rancilio-pid.cpp index d9d40730e..ac3ac356b 100644 --- a/src/rancilio-pid.cpp +++ b/src/rancilio-pid.cpp @@ -775,7 +775,7 @@ void refreshTemp() { #if ((ONE_WIRE_BUS != 16 && defined(ESP8266)) || defined(ESP32)) Temperature_C = Sensor2.getTemp(); #endif - + // Temperature_C = 94; test temp if (!checkSensor(Temperature_C) && firstreading == 0) return; // if sensor data is not valid, abort function; Sensor must // be read at least one time at system startup