Keyestudio 4DOF Manual page 234

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

Advertisement

if(pos1>180)
// limit the left turning angle
{
pos1=180;
}
}
}
//**********************************************************************
// upper arm
void xiaobi()
{
//upper arm front
if(ps2x.Analog(PSS_RY)<50) // if push the right joystick upward
{
pos2=pos2-1;
myservo2.write(pos2);
delay(5);
if(pos2<0)
// limit the lifting angle
{
pos2=0;
}
}
//upper arm back
if(ps2x.Analog(PSS_RY)>200)
{
pos2=pos2+1;
myservo2.write(pos2);
// the upper arm will lift
// if push the right joystick downward
// the upper arm will go down
231

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents