Class TrcAddressableLED.Pattern

java.lang.Object
trclib.driverio.TrcAddressableLED.Pattern
Enclosing class:
TrcAddressableLED

public static class TrcAddressableLED.Pattern extends Object
This class contains information about an LED pattern. An LED pattern contains a pattern type, an array of colors and a time interval between color changes for running patterns.
  • Field Details

  • Constructor Details

    • Pattern

      public Pattern(String name, TrcColor[] colorPattern, TrcAddressableLED.Pattern.Type type, double runningInterval)
      Constructor: Creates an instance of the object.
      Parameters:
      name - specifies the name of the pattern.
      colorPattern - specifies the color pattern as an array of colors, one for each pixel in the LED strip.
      type - specifies the pattern type.
      runningInterval - specifies the time interval in seconds between each pattern change.
    • Pattern

      public Pattern(String name, TrcColor[] colorPattern)
      Constructor: Creates an instance of the object.
      Parameters:
      name - specifies the name of the pattern.
      colorPattern - specifies the color pattern as an array of colors, one for each pixel in the LED strip.
    • Pattern

      public Pattern(String name, TrcColor color, int numLEDs, TrcAddressableLED.Pattern.Type type, double runningInterval)
      Constructor: Creates an instance of the object.
      Parameters:
      name - specifies the name of the pattern.
      color - specifies the solid color in the color pattern.
      numLEDs - specifies the number of LEDs in the color pattern.
      type - specifies the pattern type.
      runningInterval - specifies the time interval in seconds between each pattern change.
    • Pattern

      public Pattern(String name, TrcColor color, int numLEDs)
      Constructor: Creates an instance of the object.
      Parameters:
      name - specifies the name of the pattern.
      color - specifies the solid color in the color pattern.
      numLEDs - specifies the number of LEDs in the color pattern.
  • Method Details

    • commonInit

      private void commonInit(String name, TrcAddressableLED.Pattern.Type type, TrcColor[] colorPattern, double runningInterval)
      This method is called by all constructors to do common initialization.
      Parameters:
      name - specifies the name of the pattern.
      type - specifies the pattern type.
      colorPattern - specifies the color pattern as an array of colors, one for each pixel in the LED strip.
      runningInterval - specifies the time interval in seconds between each pattern change.
    • toString

      public String toString()
      Overrides:
      toString in class Object