Why does serial.read stop working?

@wildbill, I could kiss you ... well if you weren't a dude with a big bushy beard or handlebar mustache ]:slight_smile:
Anyway, your suggestion was spot on.

Here's my updated program, sans SM.

String steps[] = {
  "Strike", "Mash1", "Mash2", "Boil"};
float temps[] = {
  152,150,160,212  };
float times[]={
  .5,1,1,1};
boolean needsUserInput [] = {
  true, false, true, false};
int numSteps = (sizeof(steps)/sizeof(String));//number of steps
int count = 0;
float Setpoint;
//unsigned long time;
unsigned long currentMillis = 0;
unsigned long previousMillis = 0;
unsigned long stepTime = 0;
String currentStep = "";
boolean inputRequired = false;
boolean timesUP = false;
boolean inputReceived = false;
unsigned long stopstep;
unsigned long startstep;
boolean timercalculated;
int avgTemp1 = 160; //manual faking of temperature


void setup(){
  Serial.begin(9600);
}

void loop(){
  getStepInfo();
  timesUpCheck();
  nextStep();
  //inputReceivedCheck();
  delay(1000);
}

void getStepInfo(){
  // boolean gotoNextStep = false;
  //while (!gotoNextStep) {//necessary?
  currentStep = steps[count];
  Setpoint = temps[count];
  stepTime = (times[count] * 60000);
  inputRequired = needsUserInput[count];

  Serial.print("step=");
  Serial.print(currentStep);
  Serial.print(" temp=");
  Serial.print(Setpoint);
  Serial.print(" times=");
  Serial.print(stepTime);
  Serial.print(" user input to go to next step? ");
  Serial.print(inputRequired);
  Serial.print(" time up=");
  Serial.print(timesUP);
  Serial.print(" input received=");
  Serial.println(inputReceived);
  // }
  //count++; //does that go here or in next step
}
int nextStep(){
  if (timesUP && (avgTemp1 >= (Setpoint -5)) && inputRequired && !inputReceived){
    soundAlarm();
    inputReceivedCheck();
  }
  else if (timesUP && (avgTemp1 >= (Setpoint -5)) && inputRequired && inputReceived){
    count++;
    timesUP = false;
    inputReceived = false;
  } 
  else if (timesUP && (avgTemp1 >= (Setpoint -5)) && !inputRequired){
    count++;
    timesUP = false;
  }
  else {
  }

}

boolean timesUpCheck(){
  Serial.println(timercalculated);
  Serial.println(startstep);
  if (timercalculated == false) {
    startstep = millis(); // start step clock, reads milliseconds from this moment
    stopstep = startstep + stepTime; // calculate the end of step from the configuired time "hltpumpruntime"
    timercalculated = true; // don't do again whilst in this step
  }
  Serial.println(timercalculated);
  Serial.println(startstep);
  Serial.println(stopstep);
  Serial.println(millis());

  if (millis()>=stopstep) { // time has finished
    timesUP = true;
    timercalculated=false; // next step's timer not yet calculated
  }
  return timesUP;
}

void inputReceivedCheck(){
  String str = "";  
  while (Serial.available()>0) {
    str = Serial.readStringUntil('\n'); 
  }
  if ( str == "next"){  
    inputReceived = true;
  }
  //return inputReceived;
}

void soundAlarm(){
  Serial.println("beep beep beep");
}

Any thoughts on improvements, etc?