Skip to content

Commit 2974c64

Browse files
authored
Merge pull request #79 from plato2000/master
Fix a few things about Logitech joysticks
2 parents de0edd4 + f964b6a commit 2974c64

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

strongback/src/org/strongback/hardware/Hardware.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ public static InputDevice driverStationJoystick(int port) {
776776
}
777777

778778
/**
779-
* Create a Logitech Attack 3D flight stick controlled by the Driver Station.
779+
* Create a Logitech Attack 3 flight stick controlled by the Driver Station.
780780
*
781781
* @param port the port on the driver station that the flight stick is plugged into
782782
* @return the input device; never null
@@ -794,6 +794,25 @@ public static FlightStick logitechAttack3D(int port) {
794794
() -> joystick.getRawButton(2)); // thumb
795795
}
796796

797+
/**
798+
* Create a Logitech Extreme 3D flight stick controlled by the Driver Station.
799+
*
800+
* @param port the port on the driver station that the flight stick is plugged into
801+
* @return the input device; never null
802+
*/
803+
public static FlightStick logitechExtreme3D(int port) {
804+
Joystick joystick = new Joystick(port);
805+
return FlightStick.create(joystick::getRawAxis,
806+
joystick::getRawButton,
807+
joystick::getPOV,
808+
joystick::getY, // pitch
809+
joystick::getTwist, // yaw
810+
joystick::getX, // roll
811+
joystick::getThrottle, // flapper thing on bottom
812+
() -> joystick.getRawButton(1), // trigger
813+
() -> joystick.getRawButton(2)); // thumb
814+
}
815+
797816
/**
798817
* Create a Microsoft SideWinder flight stick controlled by the Driver Station.
799818
*

0 commit comments

Comments
 (0)