www.keyestudio.com
{
pos4=90;
}
}
}
//******************************************************
//turn
void zhuandong()
{
if(x1<50) //if push the right joystick to the right
{
pos1=pos1-1; //pos1 subtracts 1
myservo1.write(pos1); // servo 1 performs the action, the robot arm turns right.
delay(5);
if(pos1<1)
// limit the right turning angle
{
pos1=1;
}
}
if(x1>1000) // if push the right joystick to the left
{
pos1=pos1+1; //pos1 plus 1
myservo1.write(pos1); //the robot arm turns left.
delay(5);
if(pos1>180) //limit the left turning angle
{
pos1=180;
}
}
154
Need help?
Do you have a question about the 4DOF and is the answer not in the manual?
Questions and answers