EasyManua.ls Logo

Keyestudio 4DOF - Page 162

Keyestudio 4DOF
276 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
159
pos1++; //pos1 plus 1
delay(5); // delay for 5ms,controlling the rotation speed of servo.
}
}
else // if angle of servo 1 is greater than the value stored in array 1.
{
while(pos1>s1) //while loop,rotate the servo to the position of the value stored in the array.
{
myservo1.write(pos1); // servo 1 operates the motion
pos1--; //pos1 subtracts 1
delay(5); // delay for 5ms,controlling the rotation speed of servo.
}
}
//*************************************************
// the explanation is the same as servo 1
if(pos2<s2)
{
while(pos2<s2)
{
myservo2.write(pos2);
pos2++;
delay(5);
}
}
else

Related product manuals