#include <LiquidCrystal_I2C.h>
#define temp A0
const float BETA = 3950;
#define I2C_ADDR 0x27
#define LCD_COLUMNS 20
#define LCD_LINES 4
LiquidCrystal_I2C lcd(I2C_ADDR, LCD_COLUMNS, LCD_LINES);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(temp, OUTPUT);
lcd.init();
lcd.backlight();
}
void loop() {
// put your main code here, to run repeatedly:
float currTemp = analogRead(temp);
float convertedTemp = 1 / (log(1 / (1023. / currTemp - 1)) / BETA + 1.0 / 298.15) - 273.15;
lcd.setCursor(3, 0);
lcd.scrollDisplayLeft();
delay(300);
lcd.print(convertedTemp);
}