Paso 1:
Aquí está mi código para mover el telescopio
#include
Servo servoLeft; Servo servoRight;
void setup() {servoLeft.attach(10); servoRight.attach(9);}
void loop() {forward(); delay(2000) reverse(); delay(2000); turnRight(); delay(2000); turnLeft(); delay(2000); stopRobot(); delay(2000);}
Las rutinas de movimiento hacia adelante, atrás, giros y dejar vacío forward() {servoLeft.write(0); servoRight.write(180);}
reverse() anulada {servoLeft.write(180); servoRight.write(0);}
void turnRight() {servoLeft.write(180); servoRight.write(180);} void turnLeft() {servoLeft.write(0); servoRight.write(0);}
void stopRobot() {servoLeft.write(90); servoRight.write(90);}