Wazani
Wazani

Reputation: 911

How to control a servo motor using servo library in C++ on Arduino?

I try to rotate a full rotation servo motor using the Arduino Pro kit. I’m using the servo library and especially the function servo. I use Write() in order to control the speed and the direction of the servo motor using this function.

According to the Arduino C++ servo library, the parameter for the write function is the angle in the standard servo, and the speed for the full rotation servo. Now I want to know the unit of this parameter, because when I set this parameter to 45 the speed is higher than when I set it to 90! How can I fix this problem?

Upvotes: 2

Views: 8409

Answers (2)

Bhavesh Ahir
Bhavesh Ahir

Reputation: 1

I have some code example for controlling servo motors from class library, i hope you can get a little help form it.

go to:http://everysolutionshere.blogspot.in/2013/05/step-to-control-servo-motors-from-c.html

You can uses a axis card to control servo easily. It provides the better accuracy for pulse and direction controlling.

Upvotes: 0

Markus Deibel
Markus Deibel

Reputation: 1329

On a continuous rotation servo, this will set the speed of the servo (with 0 being full-speed in one direction, 180 being full speed in the other, and a value near 90 being no movement).

Source: http://arduino.cc/en/Reference/ServoWrite

Upvotes: 4

Related Questions