Class LEDMulticolor

Direct Known Subclasses:
PhysicalLEDRGB, PhysicalLEDRGBLaunchpad

public class LEDMulticolor extends LED
A multicolor indicator LED.
  • Constructor Details

    • LEDMulticolor

      public LEDMulticolor(String id)
      Creates a new LED.
      Parameters:
      id - The ID string for the LED to use.
  • Method Details

    • setupNetworkTables

      public void setupNetworkTables(NetworkTable table)
      Description copied from class: Control
      Called by the Control class when the NetworkTable is set by Control.setTable(NetworkTable). intended to be called outside of the class.

      This should create all of the NetworkTables publishers and subscribers for the inheritting class.

      Overrides:
      setupNetworkTables in class LED
      Parameters:
      table - The table to use. When called by Control.setTable(NetworkTable), this is a subtable with the ID string as its key.
    • updateClient

      public void updateClient()
      Description copied from class: Control
      Updates the control's state on the client. This should get any feedback from the server, but this should not interface with the buttonbox hardware.

      This doesn't do anything by default, and should be overridden by the class inheritting this.

      Overrides:
      updateClient in class LED
    • getColor

      public Color getColor()
      Gets the color of the LED.
      Returns:
      The current color of the LED.
    • setColor

      public void setColor(Color color)
      Sets the color of the LED. Published to NetworkTables immediately.
      Parameters:
      color - The color to set.
    • setColor

      public void setColor(Color color)
      Sets the color of the LED from a WPILib Color. Published to NetworkTables immediately.
      Parameters:
      color - The color to set.