
Heres the code that we used-
void loop()
{
for(posY = 0; posY <>
{ // in steps of 1 degree
Yaxis.write(posY); // tell servo to go to posYition in variable 'posY'
delay(15); // waits 15ms for the servo to reach the posYition
}
for(posY = 46; posY <>
{ // in steps of 1 degree
Yaxis.write(posY); // tell servo to go to posYition in variable 'posY'
delay(15); // waits 15ms for the servo to reach the posYition
}
for(posY = 136; posY <>
{ // in steps of 1 degree
Yaxis.write(posY); // tell servo to go to posYition in variable 'posY'
delay(15); // waits 15ms for the servo to reach the posYition
}
for(posY = 180; posY>=1; posY-=1) // goes from 180 degrees to 0 degrees
{
Yaxis.write(posY); // tell servo to go to posYition in variable 'posY'
delay(15); // waits 15ms for the servo to reach the posYition
}
}