// 22.11.4562 - Muhammad Guido Augusta
#include<LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27 ,16, 2);
void setup() {
// put your setup code here, to run once:
lcd.init();
lcd.begin(16, 2);
pinMode(A0, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int value = analogRead(A0);
int persentase = map(value, 0, 1023, 0, 100);
lcd.setCursor(0, 0);
lcd.print("persentase:");
lcd.setCursor(11, 0);
lcd.print(persentase);
lcd.print(" ");
lcd.setCursor(14, 0);
lcd.print("%");
delay(500);
}