Class LEDStrip

java.lang.Object
org.chsrobotics.lib.hardware.ledStrip.LEDStrip

public class LEDStrip extends Object
Convenience wrapper around an addressable LED strip (WS2812 or 2811).
  • Constructor Details

    • LEDStrip

      public LEDStrip(int PWMChannel, int length)
      Constructs a new LEDStrip.
      Parameters:
      PWMChannel - PWM channel to use to send data to the strip.
      length - The number of pixels in the strip.
  • Method Details

    • setAnimation

      public void setAnimation(LEDAnimation animation)
      Sets the currently displayed LEDAnimation.
      Parameters:
      animation - The LEDAnimation to play through.
    • setFrame

      public void setFrame(LEDAnimationFrame frame)
      Sets the currently displayed LEDAnimation to an animation consisting of only a given frame.
      Parameters:
      frame - The LEDAnimationFrame to display.
    • update

      public void update()
      Advances to the next step of the animation.