-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJoystickPOVButton.java
More file actions
34 lines (29 loc) · 944 Bytes
/
JoystickPOVButton.java
File metadata and controls
34 lines (29 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.usfirst.frc3244.Jupiter2019.util;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.buttons.Button;
/**
* @author Ken Streeter (1519)
*/
public class JoystickPOVButton extends Button {
public static final int NORTH = 0;
public static final int NORTHEAST = 45;
public static final int EAST = 90;
public static final int SOUTHEAST = 135;
public static final int SOUTH = 180;
public static final int SOUTHWEST = 225;
public static final int WEST = 270;
public static final int NORTHWEST = 315;
private Joystick joystick;
private int desiredPOV;
public JoystickPOVButton(Joystick stick, int newDesiredPOV) {
joystick = stick;
desiredPOV = newDesiredPOV;
}
public boolean get() {
return (joystick.getPOV() == desiredPOV);
}
}