Package frc.lib

Class WritableTrigger

All Implemented Interfaces:
BooleanSupplier

public class WritableTrigger extends Trigger
A Trigger that can be manually set to true or false.
  • Constructor Details

    • WritableTrigger

      public WritableTrigger()
      Creates a new WritableTrigger with an initial state of false.
    • WritableTrigger

      public WritableTrigger(boolean initialState)
      Creates a new WritableTrigger with the specified initial state.
      Parameters:
      initialState - The initial value to seed the trigger.
  • Method Details

    • set

      public void set(boolean value)
      Sets the state of the trigger. If the state changes, it will fire associated commands on the next loop iteration.
      Parameters:
      value - The new state.
    • get

      public boolean get()
      Gets the current state of the trigger.
      Returns:
      The current state.
    • toggle

      public boolean toggle()
      Toggles the state of the trigger.
      Returns:
      The new state after toggling.