#include <Servo.h>
const int pot=A0;
const int buzzer=10;
const int servopin=9;
Servo myservo;
void setup() {
myservo.attach(servopin);
pinMode(buzzer, OUTPUT);
}
void loop() {
int potvalor=analogRead(pot);
int angle= map(potvalor,0, 1023, 0, 180);
myservo.write(angle);
}