NextBindings is an open-source bindings library for the FIRST Tech Challenge. It provides a declarative DSL for binding events to inputs, such as gamepad buttons, joysticks, and limit switches.
The docs are at nextftc.dev/bindings.
Ensure you have a copy of FtcRobotController.
In build.dependencies.gradle, add the dependency:
implementation 'dev.nextftc:bindings:VERSION'Replace VERSION with the latest version (shown at the top of this README).
Add the following code to your OpMode:
// in loop, or onUpdate with NextFTC:
BindingManager.update();
// in stop, or onStop with NextFTC:
BindingManager.reset();To bind to a button, do:
Kotlin:
whenButton { gamepad1.a } isPressed { runSomeCode() }Java:
whenButton(() -> gamepad1.a).isPressed(() -> runSomeCode());For more in-depth usage, read the docs.
- Kotlin - A modern, expressive, statically typed, general-purpose programming language for the JVM developed by JetBrains and sponsored by Google.
- Gradle – Powerful build system for automating compilation, testing, and publishing
- Kotest – Flexible and expressive testing framework for Kotlin
- MockK – Mocking library for Kotlin
We use Semantic Versioning for versioning. For the versions available, see the releases on this repository.
See also the list of contributors who participated in this project.
This project is licensed under the GNU General Public License v3.0
You are free to use, modify, and distribute this software under the terms of the GPLv3. Any derivative work must also be distributed under the same license.
See the LICENSE for more information.