#include <Servo.h>
Servo servo;
const int potentiometerPin = A0;
const int servoPin = 8;
int potentiometerValue = 0;
void setup() {
servo.attach(servoPin);
}
void loop() {
potentiometerValue = analogRead(potentiometerPin);
int refeshValue = map(potentiometerValue, 0, 1023, 0, 180);
servo.write(refeshValue);
delay(10);
}