#include <LiquidCrystal.h>
LiquidCrystal lcd(18,17,23,22,21,19);
const float BETA = 3950;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
analogReadResolution(10);
Serial.println("Hello, ESP32!");
lcd.begin(16,2);
lcd.setCursor(0,0);
lcd.print("V3423017");
}
void loop() {
lcd.setCursor(0, 1);
int analogValue = analogRead(13);
float celsius = 1 / (log(1 / (1023. / analogValue - 1)) / BETA + 1.0 / 298.15) - 273.15;
lcd.print("Suhu: ");
lcd.print(celsius);
lcd.print(" C");
delay(1000);
}