Video on how to build base- como construir el base
Video on Robotic Arms/ Brazo Robotica
When you are on page 13 carefully using a pencil helps you be able to put the nuts and screws in better. - Cuando esté en la página 13, el uso cuidadoso de un lápiz le ayuda a colocar mejor las tuercas y los tornillos.
Final Robot Build Instructions/
Instrucciones finales de construcción del robot
SERVO CAlibration Code
//Start of code
#include <Servo.h>
Servo Servo_0;
Servo Servo_1;
Servo Servo_2;
Servo Servo_3;
void setup()
{
Serial.begin(57600);
Servo_0.attach(4);
Servo_1.attach(5);
Servo_2.attach(6);
Servo_3.attach(7);
}
void loop()
{
Servo_0.write(90);
Servo_1.write(90);
Servo_2.write(90);
Servo_3.write(170);
while (1);
}
Control to Arm Code
// Start of Code
#include <Servo.h>
Servo Servo_0;
Servo Servo_1;
Servo Servo_2;
Servo Servo_3;
int SensVal0 = 0;
int SensVal1 = 0;
int SensVal2 = 0;
int SensVal3 = 0;
int M0 = 0, M1 = 0, M2 = 0, M3 = 0;
void ReadPot()
{
SensVal0 = analogRead(A0);
SensVal1 = analogRead(A1);
SensVal2 = analogRead(A2);
SensVal3 = analogRead(A3);
}
void Mapping0()
{
SensVal0 = map(SensVal0, 0, 1023, 10, 170);
SensVal1 = map(SensVal1, 0, 1023, 10, 170);
SensVal2 = map(SensVal2, 0, 1023, 10, 170);
SensVal3 = map(SensVal3, 0, 1023, 100, 180);
}
void setup()
{
Serial.begin(57600);
Servo_0.attach(4);
Servo_1.attach(5);
Servo_2.attach(6);
Servo_3.attach(7);
pinMode(3, INPUT);
ReadPot();
Mapping0();
M0 = SensVal0;
M1 = SensVal1;
M2 = SensVal2;
M3 = SensVal3;
}
void loop() {
ReadPot();
Serial.print("SensVal[0]:");
Serial.println(SensVal0);
Serial.print("SensVal[1]:");
Serial.println(SensVal1);
Serial.print("SensVal[2]:");
Serial.println(SensVal2);
Serial.print("SensVal[3]:");
Serial.println(SensVal3);
delay(2);
Mapping0();
//The first axis.
if ((SensVal0 - M0) >= 0)
{
for (; M0 <= SensVal0; M0++)
{
Servo_0.write(M0); delay(2);
}
}
else
{
for (; M0 > SensVal0; M0--)
{
Servo_0.write(M0); delay(2);
}
}
//The second axis.
if ((SensVal1 - M1) >= 0)
{
for (; M1 <= SensVal1; M1++)
{
Servo_1.write(M1); delay(2);
}
}
else
{
for (; M1 > SensVal1; M1--)
{
Servo_1.write(M1); delay(2);
}
}
//The third axis.
if ((SensVal2 - M2) >= 0)
{
for (; M2 <= SensVal2; M2++)
{
Servo_2.write(M2); delay(2);
}
}
else
{
for (; M2 > SensVal2; M2--)
{
Servo_2.write(M2); delay(2);
}
}
//The fourth axis.
if ((SensVal3 - M3) >= 0)
{
for (; M3 <= SensVal3; M3++)
{
Servo_3.write(M3); delay(2);
}
}
else
{
for (; M3 > SensVal3; M3--)
{
Servo_3.write(M3); delay(2);
}
}
M0 = SensVal0;
M1 = SensVal1;
M2 = SensVal2;
M3 = SensVal3;
delay(10);
}
Video on Robotic Arm/ Video del Brazo Robotico