EasyManua.ls Logo

Keyestudio 4DOF - Page 176

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...
173
if(pos1<jiyi1[k]) // if the current servo 1 angle is less than the value stored in array 1.
{
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); // delay 5ms,controlling the servo rotating speed
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]) //while loop, make servo turn to the position of value stored in the array.
{
myservo1.write(pos1); // servo 1 performs the action
delay(5); //delay 5ms,controlling the servo rotating speed
pos1--; //pos1 subtracts 1
//Serial.println(pos1);
}
}
//***************************************************************
//the explanation is the same as the previous servo
if(pos2<jiyi2[k])
{
while(pos2<jiyi2[k])
{

Related product manuals