Package com.marslib.hmi
Class LEDIOCANdle
java.lang.Object
com.marslib.hmi.LEDIOCANdle
- All Implemented Interfaces:
LEDIO
LED IO layer using the CTRE CANdle (Connected via CAN bus). The CANdle supports addressable LED
strips and provides solid/strobe effects natively via Phoenix 6 control requests.
Students: The CANdle is a CAN-connected LED controller from CTRE. It supports up to 8 onboard
LEDs (indices 0-7) and an attached strip (indices 8+). This implementation uses Phoenix 6's
SolidColor control requests with RGBWColor.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.marslib.hmi.LEDIO
LEDIO.State -
Constructor Summary
ConstructorsConstructorDescriptionLEDIOCANdle(int canId, String canbus, int numLeds) Constructs a CANdle LED IO layer. -
Method Summary
Modifier and TypeMethodDescriptionvoidSets the LED strip to a critical fault flash pattern (e.g., flashing red).voidSets the LED strip to its default idle color pattern (e.g., solid team color).voidSets the LED strip to a warning pattern indicating active power load shedding.voidupdate()Pushes the current color buffer to the physical LED hardware.
-
Constructor Details
-
LEDIOCANdle
Constructs a CANdle LED IO layer.- Parameters:
canId- The CAN ID of the CANdle device.canbus- The CAN bus name (e.g., "rio" or "canivore").numLeds- The total number of LEDs (onboard + strip).
-
-
Method Details
-
setDefaultColors
public void setDefaultColors()Description copied from interface:LEDIOSets the LED strip to its default idle color pattern (e.g., solid team color).- Specified by:
setDefaultColorsin interfaceLEDIO
-
setLoadSheddingColors
public void setLoadSheddingColors()Description copied from interface:LEDIOSets the LED strip to a warning pattern indicating active power load shedding.- Specified by:
setLoadSheddingColorsin interfaceLEDIO
-
setCriticalFaultFlash
public void setCriticalFaultFlash()Description copied from interface:LEDIOSets the LED strip to a critical fault flash pattern (e.g., flashing red).- Specified by:
setCriticalFaultFlashin interfaceLEDIO
-
update
public void update()Description copied from interface:LEDIOPushes the current color buffer to the physical LED hardware.
-