Class DriverStation

java.lang.Object
org.wpilib.driverstation.DriverStation

public final class DriverStation extends Object
Provides access to Driver Station functionality.
  • Method Details

    • getGenericHID

      public static GenericHID getGenericHID(int port)
      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

      public static Gamepad getGamepad(int port)
      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

      public static void startDataLog(DataLog log)
      Starts logging DriverStation data to data log, including joystick data. Repeated calls are ignored.
      Parameters:
      log - data log
    • startDataLog

      public static void startDataLog(DataLog log, boolean logJoysticks)
      Starts logging DriverStation data to data log. Repeated calls are ignored.
      Parameters:
      log - data log
      logJoysticks - 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.