#include <LiquidCrystal_I2C.h> // address, width, height
LiquidCrystal_I2C lcd(0x27, 20, 4);
const float BETA = 3950; // should match the Beta Coefficient of the thermistor
void setup() {
Serial.begin(9600);
lcd.init();
lcd.backlight();
}
void loop() {
int analogValue = analogRead(A0);
float TempC = 1 / (log(1 / (1023. / analogValue - 1)) / BETA + 1.0 / 298.15) - 273.15;
float TempF = TempC * 9 / 5 + 32;
Serial.print("Temperatura: ");
Serial.print(TempC);
Serial.print(" ℃");
Serial.print(" ~ "); // separator between Celsius and Fahrenheit
Serial.print(TempF); // print the temperature in Fahrenheit
Serial.println("°F");
lcd.setCursor(0,0);
lcd.print("Temp: ");
lcd.print(TempC); // print the temperature in Celsius
lcd.print(" °C");
lcd.setCursor(6,1);
lcd.print(TempF); // print the temperature in Fahrenheit
lcd.println("°F");
delay(1000);
}