| 1 | The Logitech F310 game controller is an inexpensive alternative to the standard Xbox controller that can be purchased form $15 to [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. |
| 2 | |
| 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 |
| 10 | |
| 11 | So, for example, to read the right joystick position: |
| 12 | {{{ |
| 13 | XboxController xbox = new XboxController(0); |
| 14 | double right_X = xbox.getRawAxis(4); |
| 15 | double right_Y = xbox.getRawAxis(5); |
| 16 | }}} |