Interface SpectrumLEDs.CANdlePattern

Enclosing class:
SpectrumLEDs
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface SpectrumLEDs.CANdlePattern
Functional interface for a LED pattern that drives a segment of a CANdle strip.

Implementations receive the live CANdle device, the first LED index in this instance's segment (startIdx), and the number of LEDs in the segment ( numLeds). Hardware animation patterns call CoreCANdle.setControl(com.ctre.phoenix6.controls.ModulateVBatOut), software patterns call CoreCANdle.setControl(SolidColor) (one-shot, resent each loop).

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyTo(CANdle candle, int startIdx, int numLeds)
    Apply this pattern to the given LED segment.
  • Method Details

    • applyTo

      void applyTo(CANdle candle, int startIdx, int numLeds)
      Apply this pattern to the given LED segment.
      Parameters:
      candle - the CANdle device to write to
      startIdx - the first LED index (inclusive); 0 includes the 8 onboard LEDs
      numLeds - the number of LEDs in this segment