Package trclib.driverio
Class TrcAddressableLED.Pattern
java.lang.Object
trclib.driverio.TrcAddressableLED.Pattern
- Enclosing class:
- TrcAddressableLED
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.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor: Creates an instance of the object.Pattern
(String name, TrcColor[] colorPattern, TrcAddressableLED.Pattern.Type type, double runningInterval) Constructor: Creates an instance of the object.Constructor: Creates an instance of the object.Pattern
(String name, TrcColor color, int numLEDs, TrcAddressableLED.Pattern.Type type, double runningInterval) Constructor: Creates an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
commonInit
(String name, TrcAddressableLED.Pattern.Type type, TrcColor[] colorPattern, double runningInterval) This method is called by all constructors to do common initialization.toString()
-
Field Details
-
name
-
type
-
colorPattern
-
runningInterval
public double runningInterval
-
-
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
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
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
-