#include <Servo.h>
int servoPin = 9;
int potPin = A2;
int servoAngle = 0;
int br = 9600;
int potVal;
int dt = 50;
String prompt = "What Angle do you Desire?";
Servo myServo;
void setup() {
// put your setup code here, to run once:
Serial.begin(br);
pinMode(potPin, INPUT);
myServo.attach(servoPin);
}
void loop() {
// put your main code here, to run repeatedly:
potVal = analogRead(potPin);
servoAngle = (-180. / 1023.) * potVal + 180;
Serial.println(servoAngle);
myServo.write(servoAngle);
delay(dt);
}