- All Known Implementing Classes:
Ws281xLedStrip
public interface LedStrip
-
Method Summary
Modifier and TypeMethodDescriptionint
Get the current brightness value of the stripint
Get the number of LEDs in this striplong
getPixel
(int pixel) Get the color of a pixelvoid
render()
Render the current values to the physical light strip.void
setBrightness
(int brightness) Set the brightness value from 0-255void
setPixel
(int pixel, int red, int green, int blue) Set the color of an individual pixelvoid
Set the color of an individual pixelvoid
setStrip
(int red, int green, int blue) Set all LEDs in the strip to one colorvoid
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 stripred
- The red value (0 - 255)green
- The green value (0 - 255)blue
- The blue value (0 - 255)
-
setPixel
Set the color of an individual pixel- Parameters:
pixel
- The index of the pixel in the stripcolor
- 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
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
-