I am trying to wire up and control a servo.
My servo is a standard Hitec HS-303 which is like this:
As you can see from the specs it matches the timings shown in Michael Dodaro’s example (http://mikedodaro.net/2011/12/22/using-a-servo-with-a-net-gadgeteer-camera-device/)
However when I run my code the servo always just goes to one of it’s maximum extents and just stays there. If i disconnect the signal pin from pin 8 on my extender to the servo, the servo just sits there, so somehow my signal is wrong.
My code is much simpler than Mike’s, I just get the joystick position and generate my percentage from that, as such:
At the top of my code i have the same constants as Mike:
GT.Interfaces.PWMOutput servo; static uint high = 2100000; static uint low = 900000; static uint delta = high - low;
I initialize the servo the same way:
servo = extender.SetupPWMOutput(GT.Socket.Pin.Eight);
and I set it the same way, in a timer loop…only difference being i get my percent from the joystick (which traces out fine to the display)
Joystick.Position pos = joystick.GetJoystickPostion(); uint percent = (uint)System.Math.Round(pos.X * 100); uint pulse = low + (delta * percent / 100); servo.SetPulse(20000000, pulse);
Any advice on how I can troubleshoot this? I am a newb and don’t have any fancy shit like oscilloscopes.