#include <Servo.h>
Servo myServo;
const int potPin = A5;
void setup() {
Serial.begin(9600);
myServo.attach(2);
}
void loop() {
int potValue = analogRead(potPin);
int potValue_Mapped = map(potValue, 0,1023,0,180);
Serial.print("Potentiometer Value: ");
Serial.println(potValue_Mapped);
myServo.write(potValue_Mapped);
delay(200);
}