wiki:ControlSystems/SoftwareTeam/Training/WPILib/CommandGroupProgramming

Version 1 (modified by David Albert, 5 years ago) (diff)

--

The last example showed two simple commands and how to connect them with the user interface, but the commands were simple: they set a servo position and immediately finished. In practice, robot commands often need to run continuously until something happens; for example, a command to raise an arm might start a motor moving and continue until some time has passed or an encoder indicates that the arm has moved a certain distance or a limit switch is pressed. WPILib commands make this easy. Even better, you can string several such commands together in a CommandGroup to effect complex behaviors.