#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // Set the LCD address and dimensions (16x2)
void setup() {
Serial.begin(115200);
lcd.init(); // Initialize the LCD
lcd.backlight(); // Turn on the backlight
}
void loop() {
int value = analogRead(A0);
float voltage = map(value, 0, 1023, 0, 5); // Convert analog value to voltage
float temperature = (voltage - 0.5) * 5; // Calculate temperature (example)
Serial.print("Analog Value: ");
Serial.print(value);
Serial.print(", Voltage: ");
Serial.print(voltage);
Serial.print(", Temperature: ");
Serial.println(temperature);
lcd.setCursor(0, 0); // Set cursor to the first row
lcd.print("Temp: ");
lcd.print(temperature);
lcd.print(" C");
delay(1000); // Delay for 1 second
}