Lesson 2.?: Binding Commands to Triggers
Accompanying code lesson: TODO
There are 6 methods that each schedule/cancel a command depending on how the state changes: onFalse(), onTrue(), toggleOnFalse(), toggleOnTrue(), whileFalse(), and whileTrue() . Each methods' behaviors are shown in the diagram below:

The syntax for binding a Command to a Trigger is as follows:
trigger.whileTrue(subsystem.command())For binding to a controller button, the syntax is as follows:
controller.a().whileTrue(subsystem.command())Code examples:
Kernel Overflow (Team 167, Reefscape)
Croppenheimer (Team 167, Crescendo)
Last updated
Was this helpful?