public abstract class JoystickBase extends GenericHID
GenericHID.Hand, GenericHID.HIDType, GenericHID.RumbleType
Constructor and Description |
---|
JoystickBase(int port) |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
getName()
Get the name of the HID.
|
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 |
getThrottle()
Get the throttle.
|
boolean |
getTop()
Is the top button pressed.
|
abstract boolean |
getTop(GenericHID.Hand hand)
Is the top button pressed.
|
boolean |
getTrigger()
Is the trigger pressed.
|
abstract boolean |
getTrigger(GenericHID.Hand hand)
Is the trigger pressed.
|
abstract double |
getTwist()
Get the twist value.
|
abstract GenericHID.HIDType |
getType()
Get the type of the HID.
|
double |
getZ() |
abstract double |
getZ(GenericHID.Hand hand)
Get the z 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.
|
getPort, getPOV, getRawAxis, getRawButton, getX, getX, getY, getY
public JoystickBase(int port)
public abstract double getZ(GenericHID.Hand hand)
hand
- which hand, left or rightpublic double getZ()
public abstract double getTwist()
public abstract double getThrottle()
public final boolean getTrigger()
public abstract boolean getTrigger(GenericHID.Hand hand)
hand
- which handpublic final boolean getTop()
public abstract boolean getTop(GenericHID.Hand hand)
hand
- which handpublic abstract int getPOV(int pov)
GenericHID
The POV angles start at 0 in the up direction, and increase clockwise (eg right is 90, upper-left is 315).
getPOV
in class GenericHID
pov
- The index of the POV to read (starting at 0)public abstract int getPOVCount()
GenericHID
getPOVCount
in class GenericHID
public abstract GenericHID.HIDType getType()
GenericHID
getType
in class GenericHID
public abstract java.lang.String getName()
GenericHID
getName
in class GenericHID
public abstract void setOutput(int outputNumber, boolean value)
GenericHID
setOutput
in class GenericHID
outputNumber
- The index of the output to set (1-32)value
- The value to set the output topublic abstract void setOutputs(int value)
GenericHID
setOutputs
in class GenericHID
value
- The 32 bit output value (1 bit for each output)public abstract void setRumble(GenericHID.RumbleType type, double value)
GenericHID
setRumble
in class GenericHID
type
- Which rumble value to setvalue
- The normalized value (0 to 1) to set the rumble to