#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
const int ledGreen = 4;
const int potPin = A0;
void setup() {
pinMode(ledGreen, OUTPUT);
lcd.begin(16, 2);
lcd.print("Potensiometer:");
}
void loop() {
int potValue = analogRead(potPin);
int brightness = map(potValue, 0, 1023, 0, 255);
analogWrite(ledGreen, brightness);
int percentage = map(potValue, 0, 1023, 0, 100);
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print("Persentase: " + String(percentage) + "%");
delay(100);
}