#include VarSpeedServo myservo, myservo1, myservo2; // create servo object to control a servo void setup() { myservo.attach(2); // attaches the servo on pin 9 to the servo object myservo1.attach(8); myservo2.attach(9); Serial.begin(9600);// inicializamos la comunicación serial } void loop() { Serial.println("-------------------------------------"); Serial.println("-------------------------------------"); Serial.println("REINICIANDO"); delay(1000); Serial.println("Gira brazo corto"); myservo1.write(30, 40, true); delay(1000); Serial.println("Gira brazo corto"); myservo1.write(175, 40, true); delay(1000); delay(1000); Serial.println("Gira punta"); myservo2.write(30, 60, true); delay(1000); Serial.println("Gira punta"); myservo2.write(120, 60, true); delay(1000); Serial.println("Gira brazo largo"); myservo.write(130, 25, true); // move to 180 degrees, use a speed of 30, wait until move is complete delay(2000); Serial.println("Gira brazo largo"); myservo.write(150, 25, true); // move to 180 degrees, use a speed of 30, wait until move is complete delay(2000); Serial.println("Gira brazo corto"); myservo1.write(100, 25, true); delay(1000); Serial.println("Gira brazo corto"); myservo1.write(120, 25, true); delay(1000); Serial.println("Gira brazo largo"); myservo.write(130, 25, true); // move to 0 degrees, use a speed of 30, wait until move is complete delay(1000); Serial.println("Gira brazo largo"); myservo.write(100, 25, true); // move to 0 degrees, use a speed of 30, wait until move is complete delay(1000); Serial.println("Gira brazo corto"); myservo1.write(100, 25, true); delay(1000); Serial.println("Gira brazo corto"); myservo1.write(120, 25, true); delay(1000); }