Skip to content

Commit

Permalink
fix trigger brewing
Browse files Browse the repository at this point in the history
  • Loading branch information
murmeltier08 committed Jun 6, 2022
1 parent cf6ad33 commit 2951ecf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions src/brewvoid.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void checkbrewswitch() {
}

brewswitchTrigger = reading;
Serial.println(brewswitchTrigger);
// Serial.println(brewswitchTrigger);
#endif

// Digital Analog
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/rancilio-pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2951ecf

Please sign in to comment.