I recently purchased a servo https://www.sparkfun.com/products/10189 and am wondering how to write a code to start and stop the servo at certain points. Here is what I would like to do...

Using an arduino UNO:

when you power up the UNO the servo will find the "center" and stay there when a simple pushbutton https://www.sparkfun.com/products/9190? is pushed once the servo would turn 90 degreeswhen the button is pushed the second time it would rotate 90 degrees further (to the 180* point from center)when the button is pushed the third time it would rotate 90 degreees further (to the 270* point from center)when the button is pushed the forth time it would return back to the center position.

So what you are saying is that I have the wrong type of "servo" for what I want to accomplish?

Pick up the front of a bicycle. That front tire is a continuous rotation device, like your servo. Mark the "center point". Take a picture of where you marked. Then, we can talk about how to do the same thing with the not-a-servo that you have.

It's a continuous rotation servo. There is no center point. There is no 0 degree mark, either. All such capabilities have been removed from that servo, to make it a continuous rotation servo. All that you can do with that "servo" is change the speed and direction that it rotates.

It's a continuous rotation servo. There is no center point. There is no 0 degree mark, either. All such capabilities have been removed from that servo, to make it a continuous rotation servo. All that you can do with that "servo" is change the speed and direction that it rotates.

Actually they do a disservice and are misleading even calling it a servo. It's an ex-servo, it no longer represents anything that a servo controlled motor would share with it. It should be called what it has become sense being modified:

Quote

It's a bidirectional variable speed geared motor drive that is controlled by a pwm pulse.

From a SparkFun customer:

Quote

"If this were a servo motor, it would take a set point and adjust its position to be at the corresponding location, using internal feedback. If this is a continuous rotation motor, it takes a set point and scales its speed depending on that set point, but there's no closed loop control, so it's not a "servo". This device may very well be in a package typical of servos and may even have been a servo before someone broke the feedback loop, but it's not a servo if it's continuous rotation, open-loop control."