Hey everyone, I’m very familiar with the new Command Based framework for Joystick Buttons but im struggling to figure out how to map a POV button to a whenPressed command.
We just want the button to change a variable in a subsystem using a lambda function (which is easy to implement, we just need to get the button mapping done).
Essentially in the RobotContainer, we want: new JoystickButton(operatorController, (POV UP Button)).whenPressed(() -> vision.changeTarget());
The answer is exactly what @chadr03 linked to. Just use a POVButton object. It extends “Button”, so you have all of the whenPressed/whileHeld/etc methods available