#include <LiquidCrystal.h>
int RS = 12;
int EN = 11;
int D4 = 10;
int D5 = 9;
int D6 = 6;
int D7 = 5;
int pot = A5;
int potvalue = 0;
LiquidCrystal lcd(RS, EN, D4, D5, D6, D7);
void setup() {
pinMode(pot, INPUT);
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print(" WELCOME TO "); // creating 16 characters spaces starting from coloum 1 and also align the whole text to the middle of the spaces
lcd.setCursor(0, 1);
lcd.print(" RajtronicTech ");
delay(1000);
lcd.clear();
}
void loop() {
potvalue = analogRead(pot);
potvalue = map(potvalue, 0, 1023, 0, 100); // mapping function to convert the actual reading value of the potentiometer into percentage (0 to 100%)
lcd.setCursor(0,0);
lcd.print(" POT VALUE: ");
lcd.setCursor(0,1);
lcd.print(potvalue);
lcd.print("%"); // printing the percentage symbol infront of the valeus.
lcd.print(" "); // using this to avoid on unreasonable value printing on the screen.
delay(50);
}