Documentos de Académico
Documentos de Profesional
Documentos de Cultura
h>
Servo servo1;
Servo servo2;
Servo servo3;
Int eje1=90;
Int eje2=90;
Int pinServo = 8;
Int angulo = 0;
Int boton1 = 2;
Int boton2 = 4;
Int botonA = 0;
Int botonB = 0;
Void setup(){
Servo1.attach(7);
Servo2.attach(6);
Servo3.attach(8);
Servo1.write(90);
Servo2.write(90);
Servo3.write(30);
pinMode(boton1,INPUT);
pinMode(boton2,INPUT);
Void loop(){
//SERVO 1
Eje1++;
Servo1.write(eje1);
}
Eje1--;
Servo1.write(eje1);
//SERVO 2
Eje2++;
Servo2.write(eje2);
Eje2--;
Servo2.write(eje2);
botonA = digitalRead(boton1);
botonB = digitalRead(boton2);
if(botonA == HIGH)
Angulo++;
If(30>=180)
Angulo=180;
If(botonB == HIGH)
Angulo--;
If(angulo<=0)
{
Angulo=0;
Servo3.write(angulo);
Delay(15);