#include <LiquidCrystal.h>
// initialize the LCD library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// initialize the analog input pin for the LM35 sensor
const int lm35Pin = A0;
void setup() {
// set up the LCD's number of columns and rows
lcd.begin(16, 2);
}
void loop() {
// read the analog value from the LM35 sensor
int lm35Value = analogRead(lm35Pin);
// convert the analog value to temperature in Celsius
float temperatureC = lm35Value * 0.48875855327; // (5.0 / 1023) * 100
// print the temperature value on the LCD display
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Temperature:");
lcd.setCursor(0, 1);
lcd.print(temperatureC);
lcd.print("C");
// wait for 1 second before taking another temperature reading
delay(1000);
}