Keyestudio 4DOF Manual page 111

Robot arm kit
Hide thumbs Also See for 4DOF:
Table of Contents

Advertisement

www.keyestudio.com
{
if(x1<50) // if push the right joystick to the right
{
pos1=pos1-1; //pos1 subtracts 1
myservo1.write(pos1); // servo 1 operates the motion, the arm turns right.
delay(5);
if(pos1<1)
// limit the angle when turn right
{
pos1=1;
}
}
if(x1>1000) // if push the right joystick to the let
{
pos1=pos1+1; //pos1 plus 1
myservo1.write(pos1); // arm turns left
delay(5);
if(pos1>180) // limit the angle when turn left
{
pos1=180;
}
}
}
108

Advertisement

Table of Contents
loading

Table of Contents