Class LEDIOCANdle

java.lang.Object
com.marslib.hmi.LEDIOCANdle
All Implemented Interfaces:
LEDIO

public class LEDIOCANdle extends Object implements 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

    Constructors
    Constructor
    Description
    LEDIOCANdle(int canId, String canbus, int numLeds)
    Constructs a CANdle LED IO layer.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Sets the LED strip to a critical fault flash pattern (e.g., flashing red).
    void
    Sets the LED strip to its default idle color pattern (e.g., solid team color).
    void
    Sets the LED strip to a warning pattern indicating active power load shedding.
    void
    Pushes the current color buffer to the physical LED hardware.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LEDIOCANdle

      public LEDIOCANdle(int canId, String canbus, int numLeds)
      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: LEDIO
      Sets the LED strip to its default idle color pattern (e.g., solid team color).
      Specified by:
      setDefaultColors in interface LEDIO
    • setLoadSheddingColors

      public void setLoadSheddingColors()
      Description copied from interface: LEDIO
      Sets the LED strip to a warning pattern indicating active power load shedding.
      Specified by:
      setLoadSheddingColors in interface LEDIO
    • setCriticalFaultFlash

      public void setCriticalFaultFlash()
      Description copied from interface: LEDIO
      Sets the LED strip to a critical fault flash pattern (e.g., flashing red).
      Specified by:
      setCriticalFaultFlash in interface LEDIO
    • update

      public void update()
      Description copied from interface: LEDIO
      Pushes the current color buffer to the physical LED hardware.
      Specified by:
      update in interface LEDIO