Keyestudio 4DOF Manual page 119

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

Advertisement

www.keyestudio.com
delay(10); // delay for eliminating shake
if(z1==1)
// judge again if the right key is pressed
{
s1=myservo1.read(); // read the angle value of each servo
s2=myservo2.read();
s3=myservo3.read();
s4=myservo4.read();
}
}
if(z2==1) // if the left key is pressed
{
delay(10);
if(z2==1)
{
pos1=myservo1.read(); // record the angle value of 4 servos in current posture
pos2=myservo2.read();
pos3=myservo3.read();
pos4=myservo4.read();
if(pos1<s1) // if angle of servo 1 is smaller than variable s1 value
{
116

Advertisement

Table of Contents
loading

Table of Contents