Hi there, we are having a couple errors when coding joystick buttons on the xbox controller. in the line of code
new JoystickButton(operator, Button.kB.value)
.whileHeld(() -> grabber.grabberBall(Constants.GRABBER_SPEED), grabber)
.whenReleased(() -> grabber.grabberBall(0), grabber);
The errors are on .whileHeld and the rest of the line. The error messages read “The method whileHeld(Command) in the type Button is not applicable for the arguments (() → {}, Elevator)Java(67108979)” , and “The target type of this expression must be a functional interfaceJava(553648781)”
Any help with fixing these errors would be greatly appreciated!