The code below sets up and initiates a move from 20 degrees to 170 degrees and then back to 20 degrees all at full speed waiting for each move to complete before starting the next:
`VarSpeedServo servo1;
servo1.attach(5);
servo1.write(20, 0);
servo1.wait();
servo1.write(170, 0);
servo1.wait();
servo1.write(20, 0);
servo1.wait();`
However the servo is not completing the move to 170 degrees before returning to 20 degrees.
The code below sets up and initiates a move from 20 degrees to 170 degrees and then back to 20 degrees all at full speed waiting for each move to complete before starting the next:
`VarSpeedServo servo1;
servo1.attach(5);
servo1.write(20, 0);
servo1.wait();
servo1.write(170, 0);
servo1.wait();
servo1.write(20, 0);
servo1.wait();`
However the servo is not completing the move to 170 degrees before returning to 20 degrees.