Skip to content

Commit 407ef6d

Browse files
committed
fix debrecated api
1 parent 9ff72b0 commit 407ef6d

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id "java"
3-
id "edu.wpi.first.GradleRIO2027" version "2027.0.0-alpha-1"
3+
id "edu.wpi.first.GradleRIO2027" version "2027.0.0-alpha-2"
44
id "maven-publish"
55
}
66

src/main/java/com/stuypulse/stuylib/input/gamepads/Logitech.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import com.stuypulse.stuylib.input.WPIGamepad;
88

9+
import edu.wpi.first.wpilibj.DriverStation;
910
import edu.wpi.first.wpilibj.Joystick;
1011
import edu.wpi.first.wpilibj.XboxController;
1112

@@ -28,22 +29,22 @@ protected Logitech(Joystick joystick) {
2829
// D-Pad //
2930
@Override
3031
public boolean getRawDPadUp() {
31-
return getJoystick().getPOV() == 0;
32+
return getJoystick().getPOV().equals(DriverStation.POVDirection.Up);
3233
}
3334

3435
@Override
3536
public boolean getRawDPadDown() {
36-
return getJoystick().getPOV() == 180;
37+
return getJoystick().getPOV().equals(DriverStation.POVDirection.Down);
3738
}
3839

3940
@Override
4041
public boolean getRawDPadLeft() {
41-
return getJoystick().getPOV() == 270;
42+
return getJoystick().getPOV().equals(DriverStation.POVDirection.Left);
4243
}
4344

4445
@Override
4546
public boolean getRawDPadRight() {
46-
return getJoystick().getPOV() == 90;
47+
return getJoystick().getPOV().equals(DriverStation.POVDirection.Right);
4748
}
4849

4950
/**

src/main/java/com/stuypulse/stuylib/input/gamepads/Xbox.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import com.stuypulse.stuylib.input.Gamepad;
88

9+
import edu.wpi.first.wpilibj.DriverStation;
910
import edu.wpi.first.wpilibj.GenericHID.RumbleType;
1011
import edu.wpi.first.wpilibj.XboxController;
1112

@@ -71,22 +72,22 @@ public double getRightY() {
7172
// D-Pad //
7273
@Override
7374
public boolean getRawDPadUp() {
74-
return getJoystick().getPOV() == 0;
75+
return getJoystick().getPOV().equals(DriverStation.POVDirection.Up);
7576
}
7677

7778
@Override
7879
public boolean getRawDPadDown() {
79-
return getJoystick().getPOV() == 180;
80+
return getJoystick().getPOV().equals(DriverStation.POVDirection.Down);
8081
}
8182

8283
@Override
8384
public boolean getRawDPadLeft() {
84-
return getJoystick().getPOV() == 270;
85+
return getJoystick().getPOV().equals(DriverStation.POVDirection.Left);
8586
}
8687

8788
@Override
8889
public boolean getRawDPadRight() {
89-
return getJoystick().getPOV() == 90;
90+
return getJoystick().getPOV().equals(DriverStation.POVDirection.Right);
9091
}
9192

9293
// Bumpers //

0 commit comments

Comments
 (0)