#include <Servo.h>
static const int servoPin = 13;
Servo servo1;

const int rdpin = 12;
int rdval=0;

void setup() {
  pinMode(rdpin, INPUT);
  servo1.attach(servoPin, Servo::CHANNEL_NOT_ATTACHED, 0,180);
}

void loop() {
    rdval=analogRead(rdpin);
    int posDegrees=rdval*180/4096;
    servo1.write(posDegrees);
    delay(500);
}