LEDs - chopshop-166/chopshoplib GitHub Wiki
The LED subsystem has "segment" support. When constructing a RobotMap for the subsystem, you create an LEDBuffer that has "segments" in it. Each segment has a number of tags associated with them.
When extending the LED subsystem, you can use its existing setPattern and setGlobalPattern functions to assign a pattern to a tag. This will set all segments with the associated tag, to use that given pattern.
Available patterns built in to the library:
-
AlliancePattern: Show red if the robot is on the red alliance, blue if the blue alliance, lights off if unknown. -
FirePattern/ColdFirePattern: Create (cold) fire particle effects on a line. -
FlashPattern: Flash on and off. -
IndicatorPattern: Given two colors and a boolean supplier, sets the lights to one color if the supplier returns true, and the other color otherwise. -
RainbowRoad: Exactly what it sounds like. -
SolidColorPattern: Also exactly what it sounds like. No animation. -
SpinPattern: Send a dot spinning down the LEDs. -
SupplierPattern: Given aSupplier<Color>, set the segments to the solid color that the supplier returns.