why this stops after more or less 19 minutes

i made a program for my heater but is stops every time after 19 minutes.
i have no idea why .
can some one put me in the right direction?
it runs fine for 19 mins.

_3_2_screen_jan3.ino (26.9 KB)

It possibly some String thing.
Read the How To Use stickies and put your code between tags in the proper manner </>

void loop()
{
// Snipped
     }
     if(start == 1){
      sb = 1;
      kachel_aan();
     }
     loop();
}

Why are you calling loop() at the end of loop()?

void kachel_aan()
{
// Snipped
     kachel_aan();

}

Why are you calling kachel_aan() at the end of kachel_aan()?

Frankly, I’m surprised that your code ran for 19 minutes.

Thanks for the answers.
i want it to stay in loop() and the same with kachel_aan()

void loop()
{
     int X_RawData;
     int Y_RawData;
     int X_Coord;
     int Y_Coord;
     if(start == 0){
      
      if(sb == 0){
     X_Coord=0;
     Y_Coord=0;
     myGLCD.setFont(BigFont);
     myGLCD.setColor(0, 255, 0);
     myGLCD.setBackColor(0, 0, 0);
     myGLCD.print("MakkeLeon", CENTER,30);
     myGLCD.setColor(YELLOW);     
     myGLCD.fillRect(120, 60,120+ 80,60+ 80);
     myGLCD.setColor(0, 255, 0);
     myGLCD.drawRect(120, 60,120+ 80,60+ 80);
     
     myGLCD.setColor(RED);
     myGLCD.setBackColor(YELLOW);
     myGLCD.print("START", CENTER,95);
     sb = 1;
      }
if (Touch.Pressed()) // Note this function updaes coordinates stored within library variables
  {
    /* Get the raw data for the X and Y axis at the last touch time*/
    // These are typically used for calibration purposes only
    X_RawData = Touch.RawX();
    Y_RawData = Touch.RawY();

    /* Read new raw data for the X and Y axis for touches anywhere on screen*/
    // These could be used to detect touches outside of a zone that would
    // not be detected by the Pressed function
    // These just read the screen raw values directly from the 2046 chip
    //X_RawData = Touch.RawX();
    //Y_RawData = Touch.RawY();

    /* Output the results to the serial port */
    // The values returned were captured when Pressed() was called!
    Serial.print("Raw x,y = ");
    Serial.print(X_RawData);
    Serial.print(",");
    Serial.print(Y_RawData);

    /* Read the current X and Y axis as co-ordinates at the last touch time*/
    // The values returned were captured when Pressed() was called!
    X_Coord = Touch.X();
    Y_Coord = Touch.Y();

    /* Output the results to the serial port */
    Serial.print(" : Coord x,y = ");
    Serial.print(X_Coord);
    Serial.print(",");
    Serial.print(Y_Coord);
    Serial.print(" : Zone = "); Serial.println(Touch.Zone());

    //while(Touch.Pressed()); // Wait for release
    delay(10);
    if(X_Coord > 120 && X_Coord < 190 && Y_Coord > 60 && Y_Coord < 130){
       digitalWrite(10,LOW); // nul ventilators aan  10
       digitalWrite(9,LOW); // brander ventilator aan 9
       myGLCD.setColor(0, 100,100);
       myGLCD.fillRect(120, 60,120+ 70,60+ 70);
 
      myGLCD.clrScr();
      start=1;
      sb = 1;
      tp = 0;
      autm=1;
      vullen=0;
      //delay(1000);
      kachel_aan();
      
    }
  }




     }
     if(start == 1){
      sb = 1;
      kachel_aan();
     }
     loop();
}
//---------------------------------------------------------------------------------------------------------
void kachel_aan()
{
unsigned long currentMillis = millis();
  if(tp == 0){
          tijdtemp = currentMillis;
          tp= 1;
       }
       if(tp == 1 && currentMillis - tijdtemp > 3000 ){
        //if(Watertemp < maxtemparatuur+5 && Roomtemp < kamertemparatuur+5 ){
          sb = 12;
       // }
        temp_meting();
    }
     //     if (currentMillis - tijdtemp > 9000  
                 
      if(Watertemp >= maxtemparatuur ){//maxtemparatuur
                     myGLCD.clrScr();
                     myGLCD.fillScr(BLACK); 
                     myGLCD.setColor(RED);
                     myGLCD.setFont(BigFont);
                     myGLCD.print("watertemp  reached",CENTER,130);
                     delay(2000);
                     ns = 1;
                     sb=2;
                     autm = 1;
                     uit = 1;
                     uit_schakelen();
      }  
      if(Roomtemp >= kamertemparatuur ){//kamertemparatuur
                     myGLCD.clrScr();
                     myGLCD.setColor(RED);
                     myGLCD.setFont(BigFont);
                     myGLCD.setBackColor(BLACK);                     
                     myGLCD.print("Roomtemp  reached",CENTER, 130);
                     delay(2000);
                     sb = 2;
                     autm = 1;
                     uit = 1;
                     uit_schakelen();
       }                    
              
       if(Watertemp >= 35 ){                                      
               digitalWrite(11,LOW); // water ventilator aan
       }
       /*
               else;{
               digitalWrite(11,HIGH); // water ventilator uit 
       }     
      */
  
      if (start == 1){
          int X_Coord2;
          int Y_Coord2;
     
 

  
      if (sb == 1 && Watertemp < maxtemparatuur+5 && Roomtemp < kamertemparatuur+5) 
      {
       X_Coord2=0;
       Y_Coord2=0;
       //myGLCD.clrScr();
       myGLCD.setColor(RED);
       myGLCD.fillRect(120, 30,120+ 80,30+ 80);
       myGLCD.setColor(YELLOW);
       myGLCD.drawRect(120, 30,120+ 80,30+ 80);
       myGLCD.setBackColor(RED);
       myGLCD.setColor(YELLOW);
       myGLCD.print("STOP", 125,60);
       myGLCD.setColor(BLUE);
       myGLCD.fillRect(20, 50,20+ 80,50+ 30);
       myGLCD.setColor(YELLOW);
       myGLCD.drawRect(20, 50,20+ 80,50+ 30);
       myGLCD.setBackColor(BLUE);
       myGLCD.setColor(YELLOW);
       myGLCD.print("temp", 25,58);
       myGLCD.setColor(GREEN);
       myGLCD.fillRect(220, 50,220+ 80,50+ 30);
       myGLCD.setColor(YELLOW);
       myGLCD.drawRect(220, 50,220+ 80,50+ 30);
       myGLCD.setBackColor(GREEN);
       myGLCD.setColor(BLACK);
       myGLCD.print("time", 225,58);
       myGLCD.setColor(BLUE);
       myGLCD.fillRect(20, 150,20+ 80,150+ 30);
       myGLCD.setColor(YELLOW);
       myGLCD.drawRect(20, 150,20+ 80,150+ 30);
       myGLCD.setBackColor(BLACK);
       myGLCD.setColor(YELLOW);
       myGLCD.print("Room", 25,130);
       myGLCD.setBackColor(BLUE);
       myGLCD.printNumI(Roomtemp, 25,160);
       myGLCD.setBackColor(BLACK);
       myGLCD.print("Temp", 25,185);
       myGLCD.setColor(GREEN);
       myGLCD.fillRect(220, 150,220+ 80,150+ 30);
       myGLCD.setColor(YELLOW);
       myGLCD.drawRect(220, 150,220+ 80,150+ 30);
       myGLCD.setBackColor(BLACK);
       myGLCD.print("Water", 225,130);
       myGLCD.setBackColor(GREEN);
       myGLCD.setColor(BLACK);
       myGLCD.printNumI(Watertemp, 225,160);
       myGLCD.setBackColor(BLACK);
       myGLCD.setColor(YELLOW);
       myGLCD.print("Temp", 225,185);
       myGLCD.setColor(YELLOW);
       myGLCD.fillRect(120, 150,120+ 80,150+ 30);
       myGLCD.setColor(YELLOW);
       myGLCD.drawRect(120, 150,120+ 80,150+ 30);
       myGLCD.setBackColor(BLACK);
       myGLCD.print("Wanted", 115,130);
       myGLCD.setBackColor(YELLOW);
       myGLCD.setColor(BLACK);
       myGLCD.printNumI(kamertemparatuur, 125,160);
       myGLCD.setBackColor(BLACK);
       myGLCD.setColor(YELLOW);
       myGLCD.print("Temp", 125,185);
       previousMillis=currentMillis;
       sb=2;
       
  }
       if(sb == 12){
       myGLCD.setColor(YELLOW);
       myGLCD.setBackColor(BLUE);
       myGLCD.printNumI(Roomtemp, 25,160);
       myGLCD.setColor(BLACK);
       myGLCD.setBackColor(GREEN);
       myGLCD.printNumI(Watertemp, 225,160);
       sb=2;
       }
       if(vullen == 0){
          vullen=1;
          delay(2000);
          ont_steken();
       }
       if (Touch.Pressed())   {
    
          X_Coord2 = Touch.X();
          Y_Coord2 = Touch.Y();
       if(X_Coord2 > 120 && X_Coord2 < 200 && Y_Coord2 > 30 && Y_Coord2 < 110){// stop
          myGLCD.clrScr();
          start=0;
          sb = 0;
          uit = 1;
          autm = 0;
          uit_schakelen();
          }
       if(X_Coord2 > 20 && X_Coord2 < 90 && Y_Coord2 > 30 && Y_Coord2 < 60){ //temp
          myGLCD.clrScr();
          start=3;
          sb = 3;
          temparatuur_instellen();
  
  } 
        if(X_Coord2 > 220 && X_Coord2 < 300 && Y_Coord2 > 30 && Y_Coord2 < 60){ //temp
          myGLCD.clrScr();
          start=4;
          sb = 4;
          vul_tijd();
  
  } 
       } 
        if(vullen == 2 && currentMillis- previousMillis > wt && k == 400){
          digitalWrite(8,LOW);
          sa=currentMillis;
          previousMillis=currentMillis;
          k=500;
        }
        if(currentMillis- sa > vultijd && k == 500){
          digitalWrite(8,HIGH);
          previousMillis=currentMillis;
          k=400;          
        }
        


       
     kachel_aan();

}
        
}
//--------------------------------------------------------------------------------------------------------------

}

i want it to stay in loop()

Without the call to loop() at the end of loop(), what does it do?

and the same with kachel_aan()

Recursion is NOT the way to accomplish that. while statements are.

Nick_Pyner:
It possibly some String thing.
Read the How To Use stickies and put your code between tags in the proper manner </>

With 26k of source code?

Thanks PaulS

that pointed me in the direction