Hola soy alumno de bachillerato y mi proyecto es un brazo robot, en concreto este: EEZYbotARM by daGHIZmo - Thingiverse y programarlo con una placa de arduino con el software arduino, mi código esta abajo y quiero que coja una pieza y la deje en otro lugar pero cuando le doy la corriente externa nose porque el robot no cumple la función de mi código, toda ayuda me vale gracias por la atención.
#include <Servo.h>
//declaración de los objectos SERVO
Servo HZ; // Servohorizontal
Servo HB; // Servohombro
Servo PZ; // Servopinza
//valores iniciales del brazo
int home_HZ = 110; //valor en grados
int home_HB = 110;
int home_PZ = 40;
void setup()
{
//asignación de casa servo al pin digital
HZ.attach(4);//HZ asignado al pin 4
HB.attach(7);//HB asignado al pin 7
PZ.attach(8);//PZ asignado al pin 8
//movimiento a la posición inicial del brazo
HZ.write(home_HZ);
delay(1500);
HB.write(home_HB);
delay(1500);
PZ.write(home_PZ);
delay(3000);
//movimiento inical del brazo
HZ.write(110);
delay(1000);
HB.write(155);
delay(1000);
PZ.write(40);
delay(1000);
HZ.write(110);
delay(1000);
HB.write(160);
delay(1000);
PZ.write(40);
delay(1000);
HZ.write(110);
delay(1000);
HB.write(166);
delay(1000);
PZ.write(20);
delay(1000);
HZ.write(110);
delay(1000);
HB.write(100);
delay(1000);
PZ.write(20);
delay(1000);
HZ.write(35);
delay(1000);
HB.write(100);
delay(1000);
PZ.write(20);
delay(1000);
HZ.write(35);
delay(1000);
HB.write(170);
delay(1000);
PZ.write(20);
delay(1000);
HZ.write(35);
delay(1000);
HB.write(170);
delay(1000);
PZ.write(40);
delay(1000);
HZ.write(35);
delay(1000);
HB.write(100);
delay(1000);
PZ.write(40);
delay(1000);
HZ.write(40);
delay(1000);
HB.write(100);
delay(1000);
PZ.write(20);
delay(1000);
HZ.write(135);
delay(1000);
HB.write(100);
delay(1000);
PZ.write(40);
delay(1000);
HZ.write(135);
delay(1000);
HB.write(145);
delay(1000);
PZ.write(40);
delay(1000);
HZ.write(135);
delay(1000);
HB.write(150);
delay(1000);
PZ.write(20);
delay(1000);
HZ.write(135);
delay(1000);
HB.write(100);
delay(1000);
PZ.write(20);
delay(1000);
HZ.write(35);
delay(1000);
HB.write(100);
delay(1000);
PZ.write(20);
delay(1000);
HZ.write(35);
delay(1000);
HB.write(170);
delay(1000);
PZ.write(20);
delay(1000);
HZ.write(35);
delay(1000);
HB.write(170);
delay(1000);
PZ.write(40);
delay(1000);
HZ.write(35);
delay(1000);
HB.write(100);
delay(1000);
PZ.write(40);
delay(1000);
HZ.write(35);
delay(1000);
HB.write(100);
delay(1000);
PZ.write(20);
delay(1000);
HZ.write(35);
delay(1000);
HB.write(105);
delay(1000);
PZ.write(40);
delay(1000);
HZ.write(35);
delay(1000);
HB.write(100);
delay(1000);
PZ.write(20);
delay(1000);
HZ.write(35);
delay(1000);
HB.write(105);
delay(1000);
PZ.write(40);
delay(1000);
}
void loop()
{
//
}