#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
lcd.init();
lcd.backlight();
zobraz("ahoj");
}
#define BETA 3950
float lastCelsius = 0;
float celsius = 0;
void loop() {
int reading = analogRead(A0);
lastCelsius = celsius;
celsius = 1 / (log(1 / (1023.0 / reading - 1)) / BETA + 1.0 / 298.15) - 273.15;
if(lastCelsius!=celsius){
zobraz(String(celsius,1));
}
}
void zobraz(String vypis){
lcd.clear();
lcd.setCursor(16-vypis.length(),1);
lcd.print(vypis);
}