Skip to content

NextFTC/NextBindings

Repository files navigation

NextBindings

GitHub Release GitHub Repo stars GitHub last commit

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.

Getting Started

Prerequisites

Ensure you have a copy of FtcRobotController.

Installing

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).

Basic Usage

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.

Built With

  • 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

Versioning

We use Semantic Versioning for versioning. For the versions available, see the releases on this repository.

Authors

See also the list of contributors who participated in this project.

License

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.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages