Tstart=Tc;// support variable to store temp at beginning, so that we can be sure it's increasing
delay(1001);// make sure we only set startTime once!
delay(1001);// make sure we only set Tstart once!
}
// check if temperature is within the acceptable range and break out of the loop without error if done heating:
@ -387,7 +408,7 @@ void Press() {
Serial.write("Pressed\n");
break;
}
if(millis()-startTime>15000){
if(millis()-startTime>20000){// changed from 15s to 20s to account for motor slowdown over the years
delay(100);
Serial.write("p-end of pressing not detected\n");
digitalWrite(wheelPin,LOW);
@ -421,7 +442,7 @@ void unPress() {
Serial.write("UnPressed\n");
break;
}
if(millis()-startTime>15000){
if(millis()-startTime>20000){// changed from 15s to 20s to account for motor slowdown over the years
delay(100);
Serial.write("u-end of unPressing not detected\n");
digitalWrite(invertWheelPin,LOW);
@ -437,15 +458,18 @@ void Pump() {
digitalWrite(greenLED,LOW);
delay(100);
Serial.write("pumping Water...\n");
pumpStatus=1;// set pumpStatus variable to 1 to tell Heat() function to pump
pumpStatus=1;// set pumpStatus variable to 1 to tell Heat() function to pump; this is so that Proportional heating control can still function while pumping, preventing overheat
Heat();// call Heat function with current parameters
pumpStatus=0;// set pumpStatus variable to 0
// OLD PUMPING LOGIC BEFORE MOVING INSIDE Heat()
//digitalWrite(pumpPin, HIGH);
//while (pumpRatio > 1) {
// pumpRatio--;
// delay(1000);
//}
//digitalWrite(pumpPin, LOW);
delay(100);
Serial.write("Pumping water done\n");
digitalWrite(greenLED,HIGH);
@ -504,7 +528,7 @@ void makeCoffee() {
delay(1000);// this delay is mandatory to prevent powder spillage caused by grinder inertia.
// Slightly move the press in the opposite direction to make sure the press sensor makes contact
// Slightly move the press in the opposite direction to make sure the press sensor detects contact
digitalWrite(wheelPin,HIGH);
delay(1000);
digitalWrite(wheelPin,LOW);
@ -535,6 +559,11 @@ void makeCoffee() {
Pump();// Pump ratio (in seconds) will be read from serial input in final release
digitalWrite(boilerPin,LOW);
}
// Slightly move the press back to create a way for vapor to escape (added 19/11/24)
digitalWrite(invertWheelPin,HIGH);
delay(3000);
digitalWrite(invertWheelPin,LOW);
delay(3000);// Allow pressure to wane
unPress();// unpressing the press to reset the machine