#include <LiquidCrystal.h>
LiquidCrystal lcd(18,17,23,22,21,19); //rs, e, d4, d5, d6,d7
const float BETA = 3950; // should match the Beta Coefficient of the thermistor
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
analogReadResolution(10);
lcd.begin(16,2);//inisialisasi
lcd.setCursor(0,0);
lcd.print("V3423073");
lcd.setCursor(5,1);
lcd.write(0b11011111);
lcd.setCursor(6,1);
lcd.print("C");
}
void loop() {
int analogValue = analogRead(34);
float celsius = 1 / (log(1 / (1023. / analogValue - 1)) / BETA + 1.0 / 298.15) - 273.15;
Serial.print("Temperature: ");
Serial.print(celsius);
Serial.println(" ℃");
lcd.setCursor(0,1);
lcd.print(celsius);
delay(500);
}