#include <Servo.h>
#include <LiquidCrystal_I2C.h>
Servo mys;
#define addr 0x27
#define colms 16
#define lines 2
LiquidCrystal_I2C lcd(addr,colms,lines);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
mys.attach(6);
pinMode(A0, INPUT);
lcd.init();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("The value is : ");
}
void loop() {
// put your main code here, to run repeatedly:
int pos=0;
int val =0;
val = analogRead(A0);
pos=val/5.66;
mys.write(pos);
Serial.println(val);
int pval = (int)pos ;
lcd.setCursor(0,1);
lcd.print((int)pval);
}