servo test using potentiometer

#include <Servo.h>

Servo servo; // create servo obj
const int servoPin = 3; //using pin #3 on Arduino

void setup() {
servo.attach(servoPin);
}

void loop() {
// potentiometer controlling servo
int val = analogRead(A0); //initiate val, A0 value assigned to val
val = map(val, 0, 1023, 0, 169); // val range: 0-1023 -> 0-169
servo.write(val);
Serial.println(val);
delay(20);
}