Package frc.robot.userinterface
Class RumbleXboxController
java.lang.Object
edu.wpi.first.wpilibj.GenericHID
edu.wpi.first.wpilibj.XboxController
frc.robot.userinterface.RumbleXboxController
public class RumbleXboxController
extends edu.wpi.first.wpilibj.XboxController
An Xbox controller with added vibrational capabilities.
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description edu.wpi.first.wpilibj2.command.button.JoystickButtonAedu.wpi.first.wpilibj2.command.button.JoystickButtonBedu.wpi.first.wpilibj2.command.button.JoystickButtonLBedu.wpi.first.wpilibj2.command.button.JoystickButtonLSedu.wpi.first.wpilibj2.command.button.JoystickButtonRBedu.wpi.first.wpilibj2.command.button.JoystickButtonRSedu.wpi.first.wpilibj2.command.button.JoystickButtonXedu.wpi.first.wpilibj2.command.button.JoystickButtonY -
Constructor Summary
Constructors Constructor Description RumbleXboxController(int port) -
Method Summary
Modifier and Type Method Description doublegetLeftJoystickX()doublegetLeftJoystickY()doublegetLeftTrigger()intgetPOVAngle()doublegetRightJoystickX()doublegetRightJoystickY()doublegetRightTrigger()voidsetRumble(double intensity)Sets the degree to which the Xbox controller rumbles.Methods inherited from class edu.wpi.first.wpilibj.XboxController
getAButton, getAButtonPressed, getAButtonReleased, getBackButton, getBackButtonPressed, getBackButtonReleased, getBButton, getBButtonPressed, getBButtonReleased, getBumper, getBumperPressed, getBumperReleased, getStartButton, getStartButtonPressed, getStartButtonReleased, getStickButton, getStickButtonPressed, getStickButtonReleased, getTriggerAxis, getX, getXButton, getXButtonPressed, getXButtonReleased, getY, getYButton, getYButtonPressed, getYButtonReleased
-
Field Details
-
A
public final edu.wpi.first.wpilibj2.command.button.JoystickButton A -
B
public final edu.wpi.first.wpilibj2.command.button.JoystickButton B -
X
public final edu.wpi.first.wpilibj2.command.button.JoystickButton X -
Y
public final edu.wpi.first.wpilibj2.command.button.JoystickButton Y -
LB
public final edu.wpi.first.wpilibj2.command.button.JoystickButton LB -
RB
public final edu.wpi.first.wpilibj2.command.button.JoystickButton RB -
LS
public final edu.wpi.first.wpilibj2.command.button.JoystickButton LS -
RS
public final edu.wpi.first.wpilibj2.command.button.JoystickButton RS
-
-
Constructor Details
-
RumbleXboxController
public RumbleXboxController(int port)- Parameters:
port- The port the joystick is plugged into (usually 1 or 2)
-
-
Method Details
-
getLeftJoystickX
public double getLeftJoystickX()- Returns:
- The X axis of the left joystick (-1 to 1).
-
getLeftJoystickY
public double getLeftJoystickY()- Returns:
- The Y axis of the left joystick (-1 to 1).
-
getRightJoystickX
public double getRightJoystickX()- Returns:
- The X axis of the right joystick (-1 to 1).
-
getRightJoystickY
public double getRightJoystickY()- Returns:
- The Y axis of the right joystick (-1 to 1).
-
getLeftTrigger
public double getLeftTrigger()- Returns:
- The degree to which the left trigger has been pushed (0 to 1).
-
getRightTrigger
public double getRightTrigger()- Returns:
- The degree to which the right trigger has been pushed (0 to 1).
-
getPOVAngle
public int getPOVAngle() -
setRumble
public void setRumble(double intensity)Sets the degree to which the Xbox controller rumbles.- Parameters:
intensity- The value to set the rumble to (0 to 1).
-