Continuous Servos.

How do I program a continuous servos? So that when I hit button 1 it turns on and button 2 it turns off. Also how do you initialize them as well. All help on continuous servos would be appreciated.

Pretty much the same as a motor on a regular PWM controller (talon SR, Spark).

so how would I program that in the code.

Something like this


PWMSpeedController* continuousServo = new PWMSpeedController(channel);
continuousServo->Set(some_value);

Docs

Additionally, if you have instantiated a joystick, you could check for button presses similar to:


if (joystick.ButtonA())
  continuousServo->Set(0.5);
if (joystick.ButtonB())
  continuousServo->Set(0.0);