How to use interrupt function with 3.5 tft screen

Hi,
I'm still a beginner with ARDUINO, and I just need to know how to use an interrupt function with 3.5 TFT screen acquired from this site :

http://www.raspberrypiwiki.com/index.php/3.5_Inch_TFT_Color_Screen_Module

I'm implementing a program which control the temperature to a an Adjusted value using (+ and -) drawn arrows.

In the loop function, I'm measuring tempreature every 3 seconds (delay 3 seconds). However, when I try to increase the adjusted tempreature using " + and -" , the value increase by one degree after 3 seconds.

I just need the interrupt function, so that when " + and - " are pushed, the value increase or decreases immediately without waiting for the delay.

As could be seen from the screen, I didn't found an interrupt pin to do so. Even I assumed that pin 2 is the interrupt pin, does that mean than once the TFT screen is touched, the interrupt function would work ?

You do NOT need interrupts. You DO need to look at the blink without delay example. Instead of toggling the state of a pin, read the temperature.

Get rid of the useless delay() in the code you couldn't be bothered posting.

Well, as you mentioned, updating the temperature causes a continuous blink, so I tried to control this by the following code :

void loop() {
  AdjustTemp ();
  tempC = analogRead(tempPin);          // read the analog value from the lm35 sensor.
  tempC = (5.0 * tempC * 100.0)/1024.0; // convert the analog input to temperature in centigrade.
  OldTemp=int(tempC);                   // Read the temperature 1

  delay(3000);
  tempC = analogRead(tempPin);          // read the analog value from the lm35 sensor.
  tempC = (5.0 * tempC * 100.0)/1024.0; // convert the analog input to temperature in centigrade.  NewTemp=tempC;
  NewTemp=int(tempC);                   // Read temperature 2

  if (NewTemp!=OldTemp) {              // Compare temperature 1 and temperature 2 , if not equal
    myGLCD.setColor(16, 167, 103);     // set green colour
    myGLCD.fillRoundRect (5, 135, 150, 175);  // draw a rectangle within these dimensions
    myGLCD.setFont(BigFont);                  // Select big font
    myGLCD.setColor(255, 255, 255);           // select white color
    myGLCD.print("° C", 100, 150);            // Print " C " sympol
    myGLCD.printNumI(tempC,45, 150);          // Update temperature
}
}

If I removed this condition , temperature reading will be taken continuously, and the area where the temperature value is inserted will blink continuously that's why I wrote a " delay " line.

Without delay function, the temperature is updated within milliseconds, and it shows continuous variations,
with the delay function, variation are much less.

Is there another idea to prevent such a blink without delay function ?

If I removed this condition

What "condition"? delay() isn't a "condition". It's a disease.

Is there another idea to prevent such a blink without delay function ?

Why would you want to prevent "without delay"?

It does not matter how often you get the new setpoint from the TFT. It does not matter how often you read the temperature.

The LCD issues are because you are writing too often. Read, understand, and embrace the philosophy of the blink without delay example. While that example's primary goal is to change the state of the pin every time the time is right, and your goal is to write to the LCD when the time is right, it ought to be perfectly obvious what code from the example to remove, and what part of your code should go in it's place.

Two links on this forum that might be worth the read

UKHeliBob's Using millis() for timing. A beginners guide; the first post should help you to get rid of your "cold feet".

Robin's Demonstration code for several things at the same time; just in case it becomes more complicated in future :wink:

Thanks alot "PaulS" and "sterretje" for your help, and I'm grateful for you both.

PaulS: You were right, and I found out what wrong within my code. Thank you.

sterretje: The concept of (millis), and how it could be applied would really help, for now and for future works. Thanks alot.