Servo motor isn't working

We are trying to get a servo to work and it won’t even move. We’ve tried different servos and different PWM ports, but nothing happens. We are currently using this piece of code to test the servo:

Servo servo(4,8);
float servoRange = servo.GetMaxAngle() - servo.GetMinAngle();
for (float angle = servo.GetMinAngle(); angle < servo.GetMaxAngle(); angle += servoRange / 10.0) { 
	servo.SetAngle(angle); // set servo to angle 
	printf("%f
",servo.GetAngle());
	Wait(1.0); // wait 1 second 
}

Any suggestions?

… Is there a jumper attatched?

Specifically, the jumper that should be installed on the 2 pins situated right next to your servo’s PWM output on the Digital Sidecar?

Also, how new is the actual pwm wire as these have a tendancy to wear out and can sometimes become unable to conduct.

Thanks, we did put the jumper in and we tried a few different servos but I’ll keep replacing parts and see if anything works.

Can Servo’s be set to floats? I thought it was only doubles.

try this code:


Servo servo(4,8);
**double** servoRange = servo.GetMaxAngle() - servo.GetMinAngle();
for (**double** angle = servo.GetMinAngle(); angle < servo.GetMaxAngle(); angle += servoRange / 10.0) { 
	servo.SetAngle(angle); // set servo to angle 
	printf("%f
",servo.GetAngle());
	Wait(1.0); // wait 1 second