This is an Xbox Controller class for usage with the FRC WPILib.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 6 commits ahead of owatonnarobotics:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src/main/java/com/frc2879/xboxcontroller
.gitignore
.travis.yml
LICENSE
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

XboxController Build Status Release

This class wraps around the Joystick class in order to make working with Xbox360 controllers less of a pain. The values from this class can be used in two ways. You could either check each Button every cycle with .get(), or you could call commands directly from the Buttons with .whenPressed()

Setup

Add the JitPack repository to your build file

repositories {
			...
			maven { url 'https://jitpack.io' }
		}

Add the dependency

dependencies {
	        compile 'com.github.frc2879:XboxController:1.0'
	}

Usage

Initialization

myXboxController = new XboxController( <port the controller is on (starts at 0)> );
myXboxController.leftStick.setThumbstickDeadZone( .2 ); // Optional. See code below for defaults.

Using buttons

myXboxController.a.whenPressed( new MyCommand() );
myXboxController.lb.toggleWhenPressed( new MyCommand() );
myXboxController.rightStick.whenPressed( new MyCommand() );

Getting values directly

if( myXboxController.leftStick.getY() > .4 ) ...

Support of legacy methods (NOTE: These values are straight from the Joystick class. No deadzone stuff or anything)

if( xboxController.getX() > .4 ) ...