Home brewing controlled by arduino

Hi everyone,
I’m currently working on a project of beer brewing controlled by arduino.
The main goal of the program is to read the temperature of the brewing pot with a DS18B20
and then decide to heat or not.
The heating need to follow some steps determined by a time and a target temperature.
So I tried to introduce a boolean (flag) wich start a timer when the target temp is reached.
The first step work properly but the second step doesn’t work.

Please could someone more experienced look at my program and try to see why it isn’t working ?

Thanks a lot !
Bye

LCD_temp.ino (4.98 KB)

  y = millis();
  if(t1 == 0){
    x1 = 0;
  }
  else{
    x1 = y - t1;
  }
  if(t2 == 0){
    x2 = 0;
  }
  else{
    x2 = y - t2;
  }
  if(t3 == 0){
    x3 = 0;
  }
  else{
    x3 = y - t3;
  }

  if(x1<ta){
    cible = cible1;
  }
  else{
    if(x2<tb){
      cible = cible2;
    }
    else{
      if(x3<tc){
        cible = cible3;
      }
      else{
        cible = 0;
      }
    }
  }

One and two letter variable names really suck. They provide NO clue what this code is doing. If you can’t use names that mean something, you need to add some comments.