I can't test those numbers as I don't have a power supply at home. I'm curious how your work out hte duty cycle as a percentage?
On 19/01/16 18:32, John Duncan wrote:
Just a guess, you probably need to consider the whole 21.7ms or 21.3ms to be your period (46Hz or 47Hz) and then your duty cycle will be 8% or 6% respectively.

On Tue, Jan 19, 2016 at 10:32 AM, J B <k1llfre...@hotmail.co.uk <mailto:k1llfre...@hotmail.co.uk>> wrote:

    I'm trying to use the PWM module to control a parallax servo I
    purchased. I'm trying to get it to spin both ways as I need it for
    a project, I have tried to spin the servo both clockwise and anti
    clockwise but I do not know how to set a 20ms gap between each
    pulse, I need 1.7ms to go anti clockwise with a 20ms gap and 1.3ms
    with a 20ms gap to spin clockwise. I've converted the ms into
    frequency but it doesn't change the direction. When I plug the
    data cable into any pin on the entire board the servo spins
    clockwise, even when plugged into PWM0 and (pwm-stop 0) being called.

    On another point is there a dedicated ground pin? I plugged the
    PWM0 port into an oscilloscope and it was littered with static,
    according to my electrical engineering tutor there is a bad ground
    and I need to earth it.

    Another another point, my LCD display still doesn't work and I
    don't know what to do about it.

    The attachment is a datasheet for the servo I bought.

John Duncan

Reply via email to