Interface LEDWriter

All Known Implementing Classes:
AddressableLEDBuffer, AddressableLEDBufferView
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

Generic interface for writing data to an LED buffer.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    setHSV(int index, int h, int s, int v)
    Sets a specific led in the buffer.
    default void
    setLED(int index, Color color)
    Sets the RGB value for an LED at a specific index on a LED buffer.
    default void
    setLED(int index, Color8Bit color)
    Sets the RGB value for an LED at a specific index on a LED buffer.
    void
    setRGB(int index, int r, int g, int b)
    Sets the RGB value for an LED at a specific index on a LED buffer.
  • Method Details

    • setRGB

      void setRGB(int index, int r, int g, int b)
      Sets the RGB value for an LED at a specific index on a LED buffer.
      Parameters:
      index - the index of the LED to write to
      r - the value of the red channel, in [0, 255]
      g - the value of the green channel, in [0, 255]
      b - the value of the blue channel, in [0, 255]
    • setHSV

      default void setHSV(int index, int h, int s, int v)
      Sets a specific led in the buffer.
      Parameters:
      index - the index to write
      h - the h value [0-180)
      s - the s value [0-255]
      v - the v value [0-255]
    • setLED

      default void setLED(int index, Color color)
      Sets the RGB value for an LED at a specific index on a LED buffer.
      Parameters:
      index - the index of the LED to write to
      color - the color to set
    • setLED

      default void setLED(int index, Color8Bit color)
      Sets the RGB value for an LED at a specific index on a LED buffer.
      Parameters:
      index - the index of the LED to write to
      color - the color to set