Changes between Version 5 and Version 6 of ControlSystems/GameControllers/LogitechF310


Ignore:
Timestamp:
Dec 16, 2019, 11:24:46 PM (6 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/GameControllers/LogitechF310

    v5 v6  
    1313   double dirpad_X      =   xbox.getRawAxis(5); // left=-1, right=1
    1414   double dirpad_Y      =   xbox.getRawAxis(6); // down=-1, up=1
     15}}}
    1516
     17The buttons can be accessed in the same way as a joystick.  For example, in OI.java:
     18
     19{{{
     20   XboxController xbox = new XboxController(0);
     21   Button aButton = new JoystickButton(xbox, 1);
     22   Button bButton = new JoystickButton(xbox, 2);
     23   Button xButton = new JoystickButton(xbox, 3);
     24   Button yButton = new JoystickButton(xbox, 4);
     25
     26   public OI() {
     27      aButton.whenPressed(new ACommand());
     28      bButton.whenPressed(new Bcommand());
     29   }
    1630}}}