Stopping continuous servo

Aśka picture Aśka · Jan 4, 2017 · Viewed 7.3k times · Source

Do you know how to stop continuous servo in desired position?

I tried to code like this (which I found on many forums):

myservo.write(10); //moves forward
delay (1000); //waits 1s
myservo.write(90); //stops

My servo indeed moves forward for 1s then stops in the position I wanted then immediately goes back to its one position (the same position every time). I would like it to stay in the desired position. For example, I counted that in 150ms it moves for angle of 60 degrees and there it should stop and wait for next info.

I also tried to use trick to detach servo like this:

myservo.write(10);
delay(120);
myservo.detach();
delay(2000);

It works, but it is not as precise as I want it to be and I can't reach smaller angles than 100 degrees.

I'm using Servo TowerPro MG996R Robot 360 which is continuous servo.

I'm sorry if there is already the answer for my question but I promise I went through countless topics and forums! Thank you for any advices!!!

Answer