void buttonPressed()
{
if(ledOn)
{
ledOn = false;
digitalWrite(13,LOW);
}else
{
ledOn = true;
digitalWrite(13,HIGH);
}
vout=analogRead(sensor);
vout=(vout*500)/1023;
tempc=vout; // Storing value in Degree Celsius
tempf=(vout*1.8)+32; // Converting to Fahrenheit
lcd.setCursor(0,0);
lcd.print("ROOM TEMPERATURE");
lcd.setCursor(0,1);
lcd.print("C = ");
lcd.print(tempc);
lcd.print(" F = ");
lcd.print(tempf);
Serial.print("f ");
Serial.print(tempf);
}
here is the code of interrupt and i want to monitor the sensor value for about 5second.