Interface WS2811
-
- All Implemented Interfaces:
public interface WS2811
Defines WS2811 aka NeoPixels.
NOTE: when using Java
Color
settings, the brightness of the device will be applied to the colors. Example:p.brightness = .1 p.color = Color.RED
will result in an "actual" color of 25 (.1 * 255). This will conflict with adjusting the brightness of colors "manually" (e.g. if the value is 25 and brightness is .1, the actual value will be 2).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
WS2811.PixelColor
Wrapper for colors that includes an optional white level for devices that support that. An optional brightness can also be applied.
-
Method Summary
Modifier and Type Method Description Unit
off()
Shorthand for fill(Color.BLACK)
abstract Unit
fill(WS2811.PixelColor color)
Fill the entire device with this color. Unit
fill(Color color)
Fill the entire device with this color. Unit
plus(WS2811.PixelColor color)
Fill the entire device with this color. Unit
plus(Color color)
Fill the entire device with this color. abstract Unit
set(Integer index, WS2811.PixelColor color)
Set an individual pixel (this is available as an indexed value). Unit
set(Integer index, Color color)
Set an individual pixel (this is available as an indexed value). abstract Unit
set(Integer start, Integer end, WS2811.PixelColor color)
Set a range of pixels to a color. Unit
set(Integer start, Integer end, Color color)
Set a range of pixels to a color. abstract Unit
set(Integer start, Integer end, List<WS2811.PixelColor> colors)
Set a range of pixels to a range of colors. abstract Boolean
getAutoWrite()
abstract Unit
setAutoWrite(Boolean autoWrite)
abstract Float
getBrightness()
abstract Unit
setBrightness(Float brightness)
-
-
Method Detail
-
fill
abstract Unit fill(WS2811.PixelColor color)
Fill the entire device with this color. If autoWrite is enabled, the results are immediately uploaded.
-
fill
Unit fill(Color color)
Fill the entire device with this color. If autoWrite is enabled, the results are immediately uploaded. The current brightness level is also applied.
-
plus
Unit plus(WS2811.PixelColor color)
Fill the entire device with this color. If autoWrite is enabled, the results are immediately uploaded.
-
plus
Unit plus(Color color)
Fill the entire device with this color. If autoWrite is enabled, the results are immediately uploaded. The current brightness level is also applied.
-
set
abstract Unit set(Integer index, WS2811.PixelColor color)
Set an individual pixel (this is available as an indexed value). If autoWrite is enabled, the results are immediately uploaded.
-
set
Unit set(Integer index, Color color)
Set an individual pixel (this is available as an indexed value). If autoWrite is enabled, the results are immediately uploaded.The current brightness level is also applied.
-
set
abstract Unit set(Integer start, Integer end, WS2811.PixelColor color)
Set a range of pixels to a color. If autoWrite is enabled, the results are immediately uploaded.
-
set
Unit set(Integer start, Integer end, Color color)
Set a range of pixels to a color. If autoWrite is enabled, the results are immediately uploaded. The current brightness level is also applied.
-
set
abstract Unit set(Integer start, Integer end, List<WS2811.PixelColor> colors)
Set a range of pixels to a range of colors. The color list must be equal to or larger than the range specified. If autoWrite is enabled, the results are * immediately uploaded.
-
getAutoWrite
abstract Boolean getAutoWrite()
-
setAutoWrite
abstract Unit setAutoWrite(Boolean autoWrite)
-
getBrightness
abstract Float getBrightness()
-
setBrightness
abstract Unit setBrightness(Float brightness)
-
-
-
-