help with max/min thermometer

i want to add the max temp and min temp to my arduino thermometer.
but i do not know how to.
please modify my code so it works.

#include <LiquidCrystal.h> 
LiquidCrystal lcd(8,9,4,5,6,7);  
 
void setup()
{
   pinMode(3,INPUT);      //setting arduino pin3 as input
  Serial.begin(9600);   // opens serial port, sets data rate to 9600 bps
  lcd.begin(16,2);
  int sensorPin = 0; 
   
 
}
 
void loop()                     // run over and over again
{
 //getting the voltage reading from the temperature sensor
 int reading = analogRead(sensorPin);  
 
 // converting that reading to voltage, for 3.3v arduino use 3.3
 float voltage = reading * 5.0;
 voltage /= 1024.0; 
 
 
 
 // now print out the temperature
 float temperatureC = (voltage - 0.5) * 100 ;  //converting from 10 mv per degree wit 500 mV offset
                                               //to degrees ((voltage - 500mV) times 100)
 Serial.print(temperatureC); 
 Serial.println(" degrees C");
 
 
 delay(1);                                     //waiting a second
 Serial.print("temperature= "); 
  Serial.println(temperatureC);
  lcd.setCursor(0,0);
  lcd.print("Temp = ");
  lcd.print(temperatureC);
  lcd.print((char)223);
  lcd.print("C");

  delay(250);

 
}

Christmas gift

#include <LiquidCrystal.h>

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

const int sensorPin = A0;

float minT = 999;
float maxT = -999;

void setup()
{
  pinMode(3, INPUT);
  Serial.begin(9600);
  Serial.println(__FILE__);

  lcd.begin(16, 2);
}

void loop()                     // run over and over again
{
  //getting the voltage reading from the temperature sensor
  int reading = analogRead(sensorPin);

  // converting that reading to voltage, for 3.3v arduino use 3.3
  float voltage = reading * 5.0 / 1024.0;

  // converting from 10 mv per degree wit 500 mV offset
  // to degrees ((voltage - 500mV) times 100)
  float temperatureC = (voltage - 0.5) * 100 ;

  // determine min & max
  if (temperatureC < minT) minT = temperatureC;
  if (temperatureC > maxT) maxT = temperatureC;

  // now print out the temperature
  Serial.print("Temp =\t");
  Serial.print(minT);
  Serial.print("\t");
  Serial.print(temperatureC);
  Serial.print("\t");
  Serial.println(maxT);

  lcd.setCursor(0, 0);
  lcd.print("Temp = ");
  lcd.print(temperatureC);
  lcd.print((char)223);
  lcd.print("C");

  delay(250);
}

The LCD part should be no problem now.

do you need to re-set this? one way is to just reset the Arduino.

thanks robtillaart your're the best. merry christmas!

ho ho ho :wink: