#include <Servo.h>
Servo servo1;
int potPin = A0;
int potValue = 0;
int servoPos = 0;
void setup() {
servo1.attach(6);
}
void loop() {
// put your main code here, to run repeatedly:
potValue = analogRead(potPin);
servoPos = map(potValue, 0, 1023, 0, 180);
servo1.write(servoPos);
delay(15);
}