Bingu
Bingu provides a centralized, declarative system for binding XboxController buttons to WPILib Commands.
This object is designed to simplify the process of mapping controller inputs to robot actions, supporting both simple and complex command scheduling. It contains a modern DSL-based binding for clarity, flexibility, and maintainability.
Usage:
DSL-based bindings extension:
controller.bindings {
press(Button.A, MyCommand())
release(Button.A, MyReleaseCommand())
press(Button.B) { println("Pressed B!") }
hold(Button.B) { println("Holding B!") }
}Content copied to clipboard
Internally, Bingu tracks all bindings and schedules commands in its periodic loop. Each button can have a press, release, and hold command. If a button is not explicitly bound, it defaults to an InstantCommand (does nothing).
See the documentation for each function for more details and examples.