Keyestudio 4DOF Manual page 136

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

Advertisement

www.keyestudio.com
for(int k=0;k<j;k++)
{
if(pos1<jiyi1[k])
{
while(pos1<jiyi1[k]) //while loop, make servo turn to the position of value stored in the
array.
{
myservo1.write(pos1); // servo 1 performs the action
delay(5);
pos1++; //pos1 plus 1
//Serial.println(pos1);
}
}
else
// if the current servo 1 angle is greater than the value stored in array 1.
{
while(pos1>jiyi1[k])
the array.
{
myservo1.write(pos1);
delay(5);
pos1--;
//Serial.println(pos1);
// loop for j times, perform all actions saved.
// if the current servo 1 angle is less than the value stored in array 1.
// delay 5ms,controlling the servo rotating speed
//while loop, make servo turn to the position of value stored in
// servo 1 performs the action
//delay 5ms,controlling the servo rotating speed
//pos1 subtracts 1
133

Advertisement

Table of Contents
loading

Table of Contents