#include <LiquidCrystal.h>
#define POT A0 //potentiometer pin
#define LED 9

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  pinMode(LED, OUTPUT);
  lcd.begin(16, 2);
  Serial.begin(9600);
}

int prevPot = 0;
int currPot = 0;

int parseSerial()
{
  int input = Serial.parseInt();
  if (Serial.read() == '%')
    input = constrain(input, 0, 100) * 10.23 + 1;
  else
    input = constrain(input, 0, 1023);
  while (Serial.available()) //clean leftover chars
    Serial.read();
  return (input);
}

void  controller(int val)
{
  lcd.clear();
  lcd.print("LCD: " + String(val));
  lcd.setCursor(0,1);
  lcd.print("LED: " + String((int)(val / 10.23)) + "%");
  analogWrite(LED, map(val, 0, 1023, 0, 255));
}

void loop() {
  currPot = analogRead(POT);
  if (abs(currPot - prevPot) > 1)
  {
    prevPot = currPot;
    controller(currPot);
  }
  else if (Serial.available())
    controller(parseSerial());
  delay(100);
}
$abcdeabcde151015202530fghijfghij
uno:A5.2
uno:A4.2
uno:AREF
uno:GND.1
uno:13
uno:12
uno:11
uno:10
uno:9
uno:8
uno:7
uno:6
uno:5
uno:4
uno:3
uno:2
uno:1
uno:0
uno:IOREF
uno:RESET
uno:3.3V
uno:5V
uno:GND.2
uno:GND.3
uno:VIN
uno:A0
uno:A1
uno:A2
uno:A3
uno:A4
uno:A5
lcd1:VSS
lcd1:VDD
lcd1:V0
lcd1:RS
lcd1:RW
lcd1:E
lcd1:D0
lcd1:D1
lcd1:D2
lcd1:D3
lcd1:D4
lcd1:D5
lcd1:D6
lcd1:D7
lcd1:A
lcd1:K
pot1:GND
pot1:SIG
pot1:VCC
r1:1
r1:2
led1:A
led1:C