#include <Servo.h>
Servo myServo;
int pot = A0;
int j;
void setup() {
pinMode(pot, INPUT);
myServo.attach(9);
Serial.begin(9600);// put your setup code here, to run once:
}
void loop() {
j = analogRead(pot);
myServo.write(map(j ,0,1023 ,0,180))
;
Serial.println(j);// put your main code here, to run repeatedly:
}