Can I generate 5 sec delay within an interrupt program?

I am making a temperature monitoring device Thermocouple is the main sensor and I am using thermistor for room temperature sensing. I want to print the value of the thermistor on lcd using interrupts and i want the value to stay about 5 secs. the code is working but i am unable to make a delay of about 5sec while staying on the interrupt

Your code? HowToPostCode

#include "max6675.h"
#include<LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 9, 8, 7, 6); 

int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 3;
volatile boolean ledOn = false;
const int sensor=A1;
int tempc;  //variable to store temperature in degree Celsius
int tempf;  //variable to store temperature in Fahreinheit 
float vout;  //temporary variable to hold sensor reading


MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);

  
void setup() {
  Serial.begin(9600);
  pinMode(sensor,INPUT); // Configuring pin A1 as input
pinMode(2,INPUT);
pinMode(13,OUTPUT);
attachInterrupt(0,buttonPressed,RISING);
 
  lcd.begin(16,2);
  // wait for MAX chip to stabilize
  delay(500);
}
void buttonPressed()
{
  if(ledOn)
    {
    ledOn = false;
    digitalWrite(13,LOW);
    }else
      {
      ledOn = true;
      digitalWrite(13,HIGH);
    
      vout=analogRead(sensor);
      vout=(vout*500)/1023;
      
      lcd.setCursor(0,0);
      lcd.print("ROOM TEMPERATURE");
      
      lcd.setCursor(0,1);
      lcd.print("Degree in C = ");
      lcd.print(tempc);

//I WANT A 5 SECOND DELAY HERE
            }
}

void loop() 
  // basic readout test, just print the current temp


   {Serial.print("C = "); 
   Serial.println(thermocouple.readCelsius(),1);
   Serial.print("F = ");
   Serial.println(thermocouple.readFahrenheit(),1);
   lcd.setCursor(0,0);
   lcd.print("TEMPERATURE IS   ");
   lcd.setCursor(0,1);
   lcd.print("C = "); 
   lcd.print(thermocouple.readCelsius(),1);
   lcd.print("F = ");
   lcd.print(thermocouple.readFahrenheit(),1);
   delay(1000);} //Delay of 1 second for ease of viewing in serial monitor

First, do you have a pulldown resistor (10k) on pin 2? Like S1 here.
6vbduK2_d.jpg

You don’t really want a 5-second delay // HERE

You really want to setup a millis() timer and perform your function every 5 seconds. There’s a BIG difference.

Read up on “Using millis() as a timer / delay”

Why use interrupts?

The demo Several Things at a Time illustrates the use of millis() to manage timing without blocking. It may help with understanding the technique.

Have a look at Using millis() for timing. A beginners guide if you need more explanation.

It is hard to understand why there would be any requirement for interrupts in your project. Nothing seems to happen very quickly or only for a very brief time.

...R