mirror of
https://github.com/Team4388/Robot-Essentials.git
synced 2026-06-09 08:48:02 -06:00
Update documentation for Xbox Controllers
This commit is contained in:
@@ -4,8 +4,12 @@ import frc4388.controller.XboxController;
|
||||
|
||||
import edu.wpi.first.wpilibj.buttons.Button;
|
||||
|
||||
public class XBoxTriggerButton extends Button
|
||||
{
|
||||
/**
|
||||
* Mapping for the Xbox controller triggers to allow triggers to be defined as
|
||||
* buttons in {@link frc4388.robot.OI}. Checks to see if the given trigger
|
||||
* exceeds a tolerance defined in {@link XboxController}.
|
||||
*/
|
||||
public class XboxTriggerButton extends Button {
|
||||
public static final int RIGHT_TRIGGER = 0;
|
||||
public static final int LEFT_TRIGGER = 1;
|
||||
public static final int RIGHT_AXIS_UP_TRIGGER = 2;
|
||||
@@ -20,11 +24,16 @@ public class XBoxTriggerButton extends Button
|
||||
private XboxController m_controller;
|
||||
private int m_trigger;
|
||||
|
||||
public XBoxTriggerButton(XboxController controller, int trigger) {
|
||||
/**
|
||||
* Creates a Trigger-Button mapped to a specific Xbox controller and trigger
|
||||
*/
|
||||
public XboxTriggerButton(XboxController controller, int trigger) {
|
||||
m_controller = controller;
|
||||
m_trigger = trigger;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean get() {
|
||||
if (m_trigger == RIGHT_TRIGGER) {
|
||||
return m_controller.getRightTrigger();
|
||||
|
||||
Reference in New Issue
Block a user