Keyestudio 4DOF Manual page 158

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

Advertisement

www.keyestudio.com
}
//**********************************************************/
// upper arm
void xiaobi()
{
if(y1>1000) // if push the right joystick upward
{
pos2=pos2-1;
myservo2.write(pos2); // the robot arm will lift
delay(5);
if(pos2<0) // limit the lifting angle
{
pos2=0;
}
}
if(y1<50) // if push the right joystick downward
{
pos2=pos2+1;
myservo2.write(pos2); // the robot arm will go down
delay(5);
if(pos2>180) // limit the declining angle
{
pos2=180;
}
}
}
//*************************************************************/
155

Advertisement

Table of Contents
loading

Table of Contents