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