Paso 3: Conectar servos con Arduino
Conectar dos servos directamente a Arduino Uno 5vcc, gnd y señal de pines 9 y 11.
Ejecutar el sketch de Arduino como sigue:
servo.h #include
Servo1 servo, servo3;
int ledPin = 13; selecciona el pin para el LED
void setup() {}
Serial.Begin(9600);
pinMode (ledPin, salida); declara el ledPin como salida
servo1.Attach(9);
Delay(10);
servo1.Write(110); poner el dedo en posición de arranque
servo3.Attach(11);
Delay(10);
servo3.Write(71); Coloque el cursor en posición inicial
Delay(5000); Espere 5 segundos antes de empezar
}
void playKey (int slidePos) {}
servo3.Write(slidePos); mover servo control deslizante a la posición dominante
Delay(300); dar tiempo de slider para llegar
servo1.Write(85); Mueva el dedo hacia abajo y presione el botón
Delay(100); dar tiempo a bajar el dedo
servo1.Write(110); volver a coger dedo
Delay(300); dar tiempo a recoger el dedo antes de mover el slider próximo
}
void loop() {}
digitalWrite(ledPin,HIGH);
/ * playKey (165); //f delay(500); playKey (149); //g playKey (138); //a playKey (127); //b playKey (116); //c playKey (105); //d playKey (94); //e playKey (83); //f playKey (72); //g playKey (61); //a playKey (50); //b playKey (28); //c playKey (15); //d * /
cetk / /
playKey(71); playKey(60); playKey(83); playKey(170); Delay(400); playKey(116); Delay(2000);
Vengadores / /
playKey(72); playKey(94); playKey(83); playKey(50); playKey(15); playKey(28); playKey(72); playKey(94); playKey(83); Delay(2000); sorprendente gracia playKey(160); playKey(116); playKey(94); playKey(94); playKey(105); playKey(116); playKey(138); playKey(149); Delay(2000);
jones de Indiana
playKey(138); playKey(127); playKey(116); playKey(83); Delay(500); playKey(149); playKey(138); playKey(127); Delay(500); playKey (116) playKey //c (105); //d playKey (94); //e playKey (50); //c playKey (105); //d playKey (94); //e playKey (83); //f playKey (72); //g playKey (61); //a delay(2000);
Gilligan
playKey (138); //f playKey (105) //g playKey (61); //a playKey (61); //f playKey (61); //g playKey (72); //a playKey (94); //f playKey (116); //g delay(500); playKey (138); //f playKey (105) //g playKey (61); //a playKey (61); //f playKey (61); //g playKey (72); //a delay(500); playKey (138); //f playKey (105) //g playKey (61); //a playKey (61); //f playKey (61); //g playKey (72); //a playKey (28); //a delay(500); playKey (72); //a playKey (83); //a delay(500); playKey (94); //a delay(2000); //a playKey (116); //a playKey (105)
en algún lugar sobre el arco iris
playKey(127); Delay(300); playKey(50); Delay(300); playKey (61); //f delay(300); playKey(83); //g playKey (61), playKey (72); //b delay(200); //a playKey (50) playKey(125);delay(300); playKey(72);delay(300); playKey(83); CLI(); / * playKey (149); //g playKey (138); //a playKey (127); //b playKey (116); //c playKey (105); //d playKey (94); //e playKey (83); //f playKey (72); //g playKey (61); //a playKey (50); //b playKey (28); //c playKey (15); //d * /
}