#include <Servo.h>
Servo servomotor;
int potenciometro=A0;
int posicion_servo=90;
int lecturaP;
void setup() {
servomotor.attach(7);
Serial.begin(9600);
// put your setup code here, to run once:
}
void loop() {
lecturaP=analogRead(A0);
posicion_servo=map(lecturaP,0,1023,180,0);
servomotor.write(posicion_servo);
// put your main code here, to run repeatedly:
}