Class TwoButtonsAsAxis
java.lang.Object
org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.axes.TwoButtonsAsAxis
- All Implemented Interfaces:
Axis
Makes two physical gamepad buttons act as an axis (one is positive, one is negative).
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.Axis
Axis.DoubleLambda
-
Constructor Summary
ConstructorDescriptionTwoButtonsAsAxis
(Button.BoolLambda button1, Button.BoolLambda button2) Pass in two lambda expressions that return the value of aGamepad
button field: new ToggleButton( () -> gamepad.x, () -> gamepad.y, TwoButtonsAsAxis.Side.LEFT);TwoButtonsAsAxis
(Button.BoolLambda button1, Button.BoolLambda button2, double scalingFactor) In practice, the scaling factor is the output value. -
Method Summary
Modifier and TypeMethodDescriptiondouble
value()
The value of an axis depends on the implementation and its parameters.
-
Constructor Details
-
TwoButtonsAsAxis
Pass in two lambda expressions that return the value of aGamepad
button field: new ToggleButton( () -> gamepad.x, () -> gamepad.y, TwoButtonsAsAxis.Side.LEFT);- Parameters:
button1
- Represents the negative direction.button2
- Represents the positive direction.
-
TwoButtonsAsAxis
In practice, the scaling factor is the output value.
-
-
Method Details