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

public class ButtonAsAxis extends Object implements Axis
Makes a physical gamepad button act as an axis.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.Axis

    Axis.DoubleLambda
  • Constructor Summary

    Constructors
    Constructor
    Description
    Pass in a lambda expression that returns the value of a Gamepad button field: new ToggleButton( () -> gamepad.x );
    ButtonAsAxis(Button.BoolLambda button, double scalingFactor)
    In practice, the scaling factor is the output value.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    The value of an axis depends on the implementation and its parameters.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ButtonAsAxis

      public ButtonAsAxis(Button.BoolLambda button)
      Pass in a lambda expression that returns the value of a Gamepad button field: new ToggleButton( () -> gamepad.x );
    • ButtonAsAxis

      public ButtonAsAxis(Button.BoolLambda button, 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