Changes between Version 2 and Version 3 of ControlSystems/GameControllers/LogitechF310


Ignore:
Timestamp:
Nov 3, 2019, 10:26:44 PM (6 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/GameControllers/LogitechF310

    v2 v3  
    1 The Logitech F310 game controller is an inexpensive alternative to the standard Xbox controller that can be purchased for [https://www.amazon.com/Logitech-940-000110-Gamepad-F310/dp/B003VAHYQY $20 delivered].   The F310 uses different constants for accessing the joysticks so you can't rely on the constants defined in GenericHID.Hand
     1The Logitech F310 game controller is an inexpensive alternative to the standard Xbox controller that can be purchased for [https://www.amazon.com/Logitech-940-000110-Gamepad-F310/dp/B003VAHYQY $20 delivered].   The F310 has two analog joysticks and two analog triggers but uses different constants than those defined in GenericHID.Hand to access them
    22
    3 You can access the F310 joystick axes using the method xbox.getRawAxis(n) where n is the axis number.
    4    * 0=left X axis
    5    * 1=left Y axis
    6    * 2=left analog trigger
    7    * 3=right analog trigger
    8    * 4=right X axis
    9    * 5=right Y axis
     3You can access the F310 joystick axes using the method xbox.getRawAxis(n) where n is the axis number:
    104
    11 So, for example, to read the right joystick position:
    125{{{
    136   XboxController xbox = new XboxController(0);
    14    double right_X = xbox.getRawAxis(4);
    15    double right_Y = xbox.getRawAxis(5);
     7   double left_X        = xbox.getRawAxis(0);
     8   double left_Y        = xbox.getRawAxis(1);
     9   double left_trigger  = xbox.getRawAxis(2);
     10   double right_trigger = xbox.getRawAxis(3);
     11   double right_X       = xbox.getRawAxis(4);
     12   double right_Y       = xbox.getRawAxis(5);
    1613}}}