Closed drewwhis closed 4 years ago
When we create commands, there are a few steps we want to follow.
public CommandName(SubsystemUsed subsystemName)
.private SubsystemUsed mSubsystemName;
) and we need to assign the field inside the constructor (mSubsystemName = subsystemName;
).addRequirements(mSubsystemName);
).execute
(what the command is supposed to do) and isFinished
.After we've defined the command, we can assign it to a button or trigger. Default commands are handled differently (see #16).
new CommandToBeUsed(mSubsystem)
argument into the method chosen.If you need to rely on something more complicated than a button press/release, you'll need to consider the use of triggers. (https://docs.wpilib.org/en/latest/docs/software/commandbased/binding-commands-to-triggers.html)
Create a task for each command
First glance, it appears we will need commands to:
Others?