Class DriverStation
java.lang.Object
org.wpilib.driverstation.DriverStation
Provides access to Driver Station functionality.
-
Method Summary
Modifier and TypeMethodDescriptionstatic GamepadgetGamepad(int port) Gets the Gamepad object for the given port.static GenericHIDgetGenericHID(int port) Gets the GenericHID object for the given port.static voidprovideRefreshedDataEventHandle(int handle) Registers the given handle for DS data refresh notifications.static voidremoveRefreshedDataEventHandle(int handle) Unregisters the given handle from DS data refresh notifications.static voidstartDataLog(DataLog log) Starts logging DriverStation data to data log, including joystick data.static voidstartDataLog(DataLog log, boolean logJoysticks) Starts logging DriverStation data to data log.
-
Method Details
-
getGenericHID
Gets the GenericHID object for the given port. GenericHID objects are cached, so this will always return the same object for the same port.- Parameters:
port- The port index on the Driver Station that the controller is plugged into (0-5).- Returns:
- The GenericHID object for the given port.
-
getGamepad
Gets the Gamepad object for the given port. Gamepad objects are cached, so this will always return the same object for the same port.- Parameters:
port- The port index on the Driver Station that the controller is plugged into (0-5).- Returns:
- The Gamepad object for the given port.
-
startDataLog
Starts logging DriverStation data to data log, including joystick data. Repeated calls are ignored.- Parameters:
log- data log
-
startDataLog
Starts logging DriverStation data to data log. Repeated calls are ignored.- Parameters:
log- data loglogJoysticks- if true, log joystick data
-
provideRefreshedDataEventHandle
public static void provideRefreshedDataEventHandle(int handle) Registers the given handle for DS data refresh notifications.- Parameters:
handle- The event handle.
-
removeRefreshedDataEventHandle
public static void removeRefreshedDataEventHandle(int handle) Unregisters the given handle from DS data refresh notifications.- Parameters:
handle- The event handle.
-