#include <LiquidCrystal.h>
// Harorat sensorining pinlari
const int sensorPin = A0;
// LCD ekranining pinlari
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
// LCD ekranini boshlang'ichlash
lcd.begin(16, 2);
}
void loop() {
// Haroratni o'qib olish
int sensorValue = analogRead(sensorPin);
// Haroratni gradusga o'tkazish
float temperature = (sensorValue * 5.0 / 1024.0 - 0.5) * 100;
// LCD ekraniga haroratni chiqarish
lcd.setCursor(0, 0);
lcd.print("Harorat: ");
lcd.print(temperature);
lcd.print(" C");
// Bir necha soniyadan so'ng qayta ishlaymiz
delay(1000);
}