Class TrcAddressableLED


public abstract class TrcAddressableLED extends TrcPriorityIndicator<TrcAddressableLED.Pattern>
This class implements a platform independent Addressable LED device. It is intended to be extended by a platform dependent Addressable LED device to provides platform dependent methods to set the color pattern of the LED strip.
  • Field Details

  • Constructor Details

    • TrcAddressableLED

      public TrcAddressableLED(String instanceName, int numLEDs)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      numLEDs - specifies the number of LEDs in the strip.
  • Method Details

    • updateLED

      public abstract void updateLED(TrcColor[] colorPattern)
    • setRGB

      public void setRGB(int red, int green, int blue)
      This method sets the RGB color for the whole LED strip.
      Parameters:
      red - specifies the red value (0-255).
      green - specifies the green value (0-255).
      blue - specifies the blue value (0-255).
    • setHSV

      public void setHSV(double hue, double sat, double value)
      This method sets the HSV color for the whole LED strip.
      Parameters:
      hue - specifies the hue (0-180).
      sat - specifies the saturation (0-255).
      value - specifies the value (0-255).
    • setColor

      public void setColor(TrcColor color)
      This method sets the color for the whole LED strip.
      Parameters:
      color - specifies the color.
    • getPattern

      public TrcAddressableLED.Pattern getPattern()
      This method gets the current set pattern.
      Specified by:
      getPattern in class TrcPriorityIndicator<TrcAddressableLED.Pattern>
      Returns:
      currently set pattern.
    • setPattern

      public void setPattern(TrcAddressableLED.Pattern pattern)
      This method sets the pattern to the physical indicator device in a device dependent way.
      Specified by:
      setPattern in class TrcPriorityIndicator<TrcAddressableLED.Pattern>
      Parameters:
      pattern - specifies the indicator pattern. If null, turn off the indicator pattern.