Servo Issue

18 Dec 2010

Hi folks!

I purchased two HS 422 servos (from http://www.coolcomponents.co.uk/catalog/product_info.php?cPath=46&products_id=235). I am facing a problem with using the servo library, each time I run the simple code below to center the servo, the servo moves to one extreme end and stays there humming.

 

#include "mbed.h"
#include "Servo.h"

Servo s1(p21);
int main() 
{
    //wait(1);
    s1 = 0.5f;
    while(1) {}
}

Am I missing something? I am facing the same issue with both servos, so I'm inclined to believe that it has something to do with the code.

Thanks in advance,

-Devesh

 

18 Dec 2010

In addition, I'm facing the same issue when I use PwmOut directly like this:

#include "mbed.h"
#include "Servo.h"

PwmOut myServo(p21);
int main() 
{
    myServo.period_ms(20);
    myServo.pulsewidth_us(1500);
    while(1) {}
}
Am I doing something wrong here? To the best of my memory this is exactly how to use the servos.

25 Oct 2013

I am facing similar problems. Did you get a solution ?

Thanking in advance