|
Re: Servo motor help
As Alan said, you'll need to have some type of sensor which supplies feedback based on a setpoint. For example, if you are reading the angle of an extension with a single pivot point, a potentiometer, gyroscope, or encoder will suit your needs.
In this example, you'd read the output, and evaluate if it's the value you want (or at least within a range of values). If it's not, you'll have to set the motor output of the motor controlling the extension to move in either direction, based on the magnitude of your error.
If you are controlling a servo, you can use the Servo Set Angle or Servo Set Position function within the WPI Robotics Library to set the servo to a specific angle or position upon the press of a button.
|