Log in

View Full Version : Servos??? *C++*


Straberrie
02-01-2009, 13:18
Hey all,

Servo panservo(1);

float servoRange = panservo.GetMaxAngle() - panservo.GetMinAngle();
for(float angle = panservo.GetMinAngle();
angle < panservo.GetMaxAngle();
angle += servoRange / 10.0)
{
panservo.SetAngle(angle);
Wait(.1);
}

We have a servo plugged into PWM channel 1 on the primary sidecar module, and have this code in the autonomous function but the servo ceases to move. The code is mostly directly out of the programming guide, except for changing the channel number to match our setup. Any ideas/suggestions?

Thanks!

tdlrali
02-01-2009, 13:28
Do you have a jumper on the digital sidecar next to the connector to which the servo is connected?

Straberrie
02-01-2009, 14:15
http://i249.photobucket.com/albums/gg201/jabiajarika/thank%20you/glittergraphics-thanks1.gif

:] It worked!! TY!!!:]