// Control de la posición de un servo con retardo
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int val; // variable to read the value from the analog pin
void setup()
{
myservo.attach(3); // attaches the servo on pin 3 to the servo object
}
void loop()
{
myservo.write(20); // sets the servo position according to the scaled value
delay(500); // waits for the servo to get there
myservo.write(100); // sets the servo position according to the scaled value
delay(500); // waits for the servo to get there
myservo.write(900); // sets the servo position according to the scaled value
delay(500); // waits for the servo to get there
}