#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
lcd.init();
lcd.backlight();
zobraz("Namerane napatie");
}
void loop() {
int hodnota = analogRead(A0);
zobraz(map(hodnota,0,1023,0,500)/100.f);
}
void zobraz(String text){
lcd.clear();
lcd.setCursor(0,0);
lcd.print(text);
}
void zobraz(float num){
lcd.setCursor(0,1);
lcd.print(String(num,2)+" V");
}