Class DriverStationDisplay

java.lang.Object
org.wpilib.driverstation.DriverStationDisplay

public final class DriverStationDisplay extends Object
Provides access to the Driver Station display.

Line mode is the default display mode.

  • Method Details

    • setMode

      public static void setMode(DriverStationDisplay.Mode mode)
      Sets the display mode.

      DriverStationDisplay.Mode.Line is the default display mode. Setting DriverStationDisplay.Mode.Line clears any pending display lines. Setting DriverStationDisplay.Mode.RawAnsi clears the display.

      Parameters:
      mode - display mode
    • addKeyedLine

      public static void addKeyedLine(String key, String line)
      Adds display data in line mode, keyed by an identifier that is not displayed.

      Repeated calls with the same key before updateLines() replace the previous line. The key is used only to identify the line for replacement and is not displayed. Empty or whitespace-only keys always append a new line.

      Parameters:
      key - Line key.
      line - Line contents.
    • addData

      public static void addData(String caption, String line)
      Adds display data in line mode.

      Repeated calls with the same caption before updateLines() replace the previous line. The caption is used to identify the line and is displayed before the line contents, separated by " : ". Empty or whitespace-only captions always append a new line and are not displayed.

      Parameters:
      caption - Line caption.
      line - Line contents.
    • addData

      public static void addData(String caption, Object value)
      Adds display data in line mode.

      Repeated calls with the same caption before updateLines() replace the previous line. The caption is used to identify the line and is displayed before the line contents, separated by " : ". Empty or whitespace-only captions always append a new line and are not displayed.

      The value is converted to text with String.valueOf(Object).

      Parameters:
      caption - Line caption.
      value - Line value.
    • addData

      public static void addData(String caption, String format, Object... args)
      Adds formatted display data in line mode.

      Repeated calls with the same caption before updateLines() replace the previous line. The caption is used to identify the line and is displayed before the line contents, separated by " : ". Empty or whitespace-only captions always append a new line and are not displayed.

      Parameters:
      caption - Line caption.
      format - Format string.
      args - Format arguments.
    • addLine

      public static void addLine(String line)
      Adds an uncaptioned display line in line mode.

      This is equivalent to calling addKeyedLine(String, String) with an empty key, which always appends a new line.

      Parameters:
      line - Line contents.
    • updateLines

      public static void updateLines()
      Updates the display with all pending lines and clears the pending lines.

      Updates are sent at most once every 230 ms. If called before 230 ms has elapsed since the last update, the pending lines are cleared without sending.

    • writeRawAnsi

      public static void writeRawAnsi(String data)
      Writes ANSI text directly to the display in raw ANSI mode.

      This call is ignored unless the display is in raw ANSI mode.

      Parameters:
      data - ANSI text to write.
    • clearRaw

      public static void clearRaw()
      Clears the display in raw ANSI mode.

      This call is ignored unless the display is in raw ANSI mode.