Interface LedStrip

All Known Implementing Classes:
Ws281xLedStrip

public interface LedStrip
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get the current brightness value of the strip
    int
    Get the number of LEDs in this strip
    long
    getPixel(int pixel)
    Get the color of a pixel
    void
    Render the current values to the physical light strip.
    void
    setBrightness(int brightness)
    Set the brightness value from 0-255
    void
    setPixel(int pixel, int red, int green, int blue)
    Set the color of an individual pixel
    void
    setPixel(int pixel, Color color)
    Set the color of an individual pixel
    void
    setStrip(int red, int green, int blue)
    Set all LEDs in the strip to one color
    void
    setStrip(Color color)
    Set all LEDs in the strip to one color
  • Method Details

    • setPixel

      void setPixel(int pixel, int red, int green, int blue)
      Set the color of an individual pixel
      Parameters:
      pixel - The index of the pixel in the strip
      red - The red value (0 - 255)
      green - The green value (0 - 255)
      blue - The blue value (0 - 255)
    • setPixel

      void setPixel(int pixel, Color color)
      Set the color of an individual pixel
      Parameters:
      pixel - The index of the pixel in the strip
      color - The color to set on the pixel
    • setStrip

      void setStrip(int red, int green, int blue)
      Set all LEDs in the strip to one color
      Parameters:
      red - The red value (0 - 255)
      green - The green value (0 - 255)
      blue - The blue value (0 - 255)
    • setStrip

      void setStrip(Color color)
      Set all LEDs in the strip to one color
      Parameters:
      color - The color to set on the strip
    • render

      void render()
      Render the current values to the physical light strip.

      This method needs to be called after any previous setPixel calls to make the lights change to those colors.

    • getBrightness

      int getBrightness()
      Get the current brightness value of the strip
      Returns:
      The current brightness value
    • setBrightness

      void setBrightness(int brightness)
      Set the brightness value from 0-255
      Parameters:
      brightness - The brightnes to set the strip to
    • getLedsCount

      int getLedsCount()
      Get the number of LEDs in this strip
      Returns:
      The number of LEDs
    • getPixel

      long getPixel(int pixel)
      Get the color of a pixel
      Parameters:
      pixel - the index of the pixel
      Returns:
      The color of the pixel as a long