#include <Servo.h>
Servo servo;
const int potPin = A0;
const int servoPin = 7;
#define potValue analogRead(potPin)
#define angle map(potValue, 0, 1023, 0, 180)
void setup() {
Serial.begin(9600);
pinMode(potPin, INPUT);
// pinMode(servoPin, OUTPUT);
servo.attach(servoPin);
}
void loop() {
Serial.println(potValue);
Serial.println(angle);
servo.write(angle);
}