RobotCore
Robot Core Documentation
Public Member Functions | List of all members
robotCore.Joystick Class Reference

The Joystick class read the joystick connected to the driver station. More...

Inheritance diagram for robotCore.Joystick:
robotCore.GenericHID

Public Member Functions

 Joystick (int id)
 
boolean isGamepad ()
 
double getX ()
 
double getY ()
 
double getRX ()
 
double getRY ()
 
double getThrottle ()
 
double getPOV ()
 
boolean getRawButton (final int button)
 

Detailed Description

The Joystick class read the joystick connected to the driver station.

Author
John Gaby

The joystick is connected to the driver station and communicates with RobotCore via a network connection which it uses to send the current joystick x and y positions as well as the state of the buttons.

Constructor & Destructor Documentation

◆ Joystick()

robotCore.Joystick.Joystick ( int  id)
Parameters
id- This is currently unused, but is provided for compatibility with the wpilib library.

Member Function Documentation

◆ getPOV()

double robotCore.Joystick.getPOV ( )
Returns
Returns the value for the 8 position switch on the gamepad. It will return 8 descrete values in the range 0.0 to 1.0.

◆ getRawButton()

boolean robotCore.Joystick.getRawButton ( final int  button)
Returns
Returns true if the specified button is currently pressed, and false if it is not.

Reimplemented from robotCore.GenericHID.

◆ getRX()

double robotCore.Joystick.getRX ( )
Returns
Returns the current horizontal position of the right joystick on a gamepad.
The value returned will be between -1.0 and +1.0.

◆ getRY()

double robotCore.Joystick.getRY ( )
Returns
Returns the current vertical position of the right joystick on a gamepad.
The value returned will be between -1.0 and +1.0.

◆ getThrottle()

double robotCore.Joystick.getThrottle ( )
Returns
Returns the current trottle position of the joystick.
The value returned will be between -1.0 and +1.0. This value also retrieves the value of the left and right analog switches on the front of the gamepad. The left switch returns a value in the range 0.0 to 1.0, and the right switch returns a value in the range of -1.0 to 0.0.

◆ getX()

double robotCore.Joystick.getX ( )
Returns
Returns the current horizontal position of the joystick. The value returned will be between -1.0 and +1.0.

Reimplemented from robotCore.GenericHID.

◆ getY()

double robotCore.Joystick.getY ( )
Returns
Returns the current vertical position of the joystick. The value returned will be between -1.0 and +1.0.

Reimplemented from robotCore.GenericHID.

◆ isGamepad()

boolean robotCore.Joystick.isGamepad ( )
Returns
Returns true if the attached joystick is a gamepad.

The documentation for this class was generated from the following file: