public abstract class GenericHID extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
GenericHID.Hand
Which hand the Human Interface Device is associated with.
|
static class |
GenericHID.HIDType |
static class |
GenericHID.RumbleType
Represents a rumble output on the JoyStick.
|
Constructor and Description |
---|
GenericHID(int port) |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
getName()
Get the name of the HID.
|
int |
getPort()
Get the port number of the HID.
|
int |
getPOV() |
abstract int |
getPOV(int pov)
Get the angle in degrees of a POV on the HID.
|
abstract int |
getPOVCount()
For the current HID, return the number of POVs.
|
abstract double |
getRawAxis(int which)
Get the raw axis.
|
abstract boolean |
getRawButton(int button)
Is the given button pressed.
|
abstract GenericHID.HIDType |
getType()
Get the type of the HID.
|
double |
getX()
Get the x position of the HID.
|
abstract double |
getX(GenericHID.Hand hand)
Get the x position of HID.
|
double |
getY()
Get the y position of the HID.
|
abstract double |
getY(GenericHID.Hand hand)
Get the y position of the HID.
|
abstract void |
setOutput(int outputNumber,
boolean value)
Set a single HID output value for the HID.
|
abstract void |
setOutputs(int value)
Set all HID output values for the HID.
|
abstract void |
setRumble(GenericHID.RumbleType type,
double value)
Set the rumble output for the HID.
|
public GenericHID(int port)
public final double getX()
public abstract double getX(GenericHID.Hand hand)
hand
- which hand, left or rightpublic final double getY()
public abstract double getY(GenericHID.Hand hand)
hand
- which hand, left or rightpublic abstract double getRawAxis(int which)
which
- index of the axispublic abstract boolean getRawButton(int button)
button
- which button numberpublic abstract int getPOV(int pov)
The POV angles start at 0 in the up direction, and increase clockwise (eg right is 90, upper-left is 315).
pov
- The index of the POV to read (starting at 0)public int getPOV()
public abstract int getPOVCount()
public int getPort()
public abstract GenericHID.HIDType getType()
public abstract java.lang.String getName()
public abstract void setOutput(int outputNumber, boolean value)
outputNumber
- The index of the output to set (1-32)value
- The value to set the output topublic abstract void setOutputs(int value)
value
- The 32 bit output value (1 bit for each output)public abstract void setRumble(GenericHID.RumbleType type, double value)
type
- Which rumble value to setvalue
- The normalized value (0 to 1) to set the rumble to