Arduino Thermocouple, displaying maximum temp on lcd

I am very new to programming, I managed to copy and paste enough code together to display a thermocouple reading on a lcd screen, however I am trying to get the lcd to display the max temp, and have had no luck. Any ideas?

lcdthermocouple.ino (1.32 KB)

Hello and welcome,

You never set the value of tempMaxA (you also didn't declare it, there is a tempMax but no tempMaxA).

When you read the temperature, compare it with the actual value of tempMax. If the temperature is greater, then store it in tempMax. Something like this:

void loop()
{
  ...
  int currentTemperature = thermocouple.readFahrenheit();
  static int maxTemperature = currentTemperature;

  if ( currentTemperature > maxTemperature )
    maxTemperature = currentTemperature;
  ...
  lcd.print( currentTemperature );
  ...
  lcd.print( maxTemperature );
  ...
}

Simple, no?