Keyestudio 4DOF Manual page 168

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

Advertisement

if(y1<50) // if push the right joystick downward
{
pos2=pos2+1;
myservo2.write(pos2); // the upper arm will go down
delay(5);
if(pos2>180) // limit the angle when go down
{
pos2=180;
}
}
}
//*************************************************************/
// lower arm
void dabi()
{
if(y2>1000) // if push the left joystick upward
{
pos3=pos3-1;
myservo3.write(pos3); // the lower arm will stretch out
delay(5);
if(pos3<35) // limit the stretched angle
{
pos3=35;
}
}
165

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents