#include <Servo.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(2,3,4,5,6,7,8);
Servo my_motor;
int a;
int a2;
void setup() {
// put your setup code here, to run once:
my_motor.attach(10);
pinMode(A1, INPUT);
pinMode(8, OUTPUT);
lcd.begin(16,2);
}
void loop() {
// put your main code here, to run repeatedly:
//my_motor.write(180);
a = analogRead(A1);
a2=map(a,0,1023,0,180);
lcd.clear();
lcd.print(a2);
my_motor.write(a2);
delay(150);
}