java.lang.Object
org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.axes.TwoButtonsAsAxis
All Implemented Interfaces:
Axis

public class TwoButtonsAsAxis extends Object implements Axis
Makes two physical gamepad buttons act as an axis (one is positive, one is negative).
  • Constructor Details

    • TwoButtonsAsAxis

      public TwoButtonsAsAxis(Button.BoolLambda button1, Button.BoolLambda button2)
      Pass in two lambda expressions that return the value of a Gamepad button field: new ToggleButton( () -> gamepad.x, () -> gamepad.y, TwoButtonsAsAxis.Side.LEFT);
      Parameters:
      button1 - Represents the negative direction.
      button2 - Represents the positive direction.
    • TwoButtonsAsAxis

      public TwoButtonsAsAxis(Button.BoolLambda button1, Button.BoolLambda button2, double scalingFactor)
      In practice, the scaling factor is the output value.
  • Method Details

    • value

      public double value()
      Description copied from interface: Axis
      The value of an axis depends on the implementation and its parameters.
      Specified by:
      value in interface Axis