I am really struggling in getting my FEZ Mini to control a Servo. I am sure my code is correct and that I have things wired correctly.
Servo is connected to a 5V 1Amp supply
Di9 is connected to the Servo Signal
Servo supply and FEZ share a common ground
This is my Test Code:
PWM servo = new PWM((PWM.Pin)FEZ_Pin.PWM.Di9);
while (true)
{
servo.SetPulse(20000000, 1250 * 1000); // 0 degrees. 20ms period and 1.25ms high pulse
Thread.Sleep(1000);//wait for a second
servo.SetPulse(20000000, 1500 * 1000); // 90 degrees. 20ms period and 1.50ms high pulse
Thread.Sleep(1000);//wait for a second
servo.SetPulse(20000000, 1750 * 1000); // 180 degrees. 20ms period and 1.75ms high pulse
}
When I depoy and run this the Servo does not move. If I connect an LED to the signal the LED pulses dimmly as the PWM wave changes. I have verified that the 5V supply is getting to the Servo. I have also tried another Servo and another FEZ Mini.
Also for good measure I tried a level shifter to increase the PWM signal from 3.3V to 5V. Still no joy.
I am out of ideas, can anyone who has had sucess in this area give me a few pointers, thanks.