Package edu.wpi.first.wpilibj
Class AddressableLEDBuffer
java.lang.Object
edu.wpi.first.wpilibj.AddressableLEDBuffer
public class AddressableLEDBuffer extends Object
Buffer storage for Addressable LEDs.
-
Constructor Summary
Constructors Constructor Description AddressableLEDBuffer(int length)Constructs a new LED buffer with the specified length. -
Method Summary
Modifier and Type Method Description ColorgetLED(int index)Gets the color at the specified index.Color8BitgetLED8Bit(int index)Gets the color at the specified index.intgetLength()Gets the buffer length.voidsetHSV(int index, int h, int s, int v)Sets a specific led in the buffer.voidsetLED(int index, Color color)Sets a specific LED in the buffer.voidsetLED(int index, Color8Bit color)Sets a specific LED in the buffer.voidsetRGB(int index, int r, int g, int b)Sets a specific led in the buffer.
-
Constructor Details
-
AddressableLEDBuffer
Constructs a new LED buffer with the specified length.- Parameters:
length- The length of the buffer in pixels
-
-
Method Details
-
setRGB
Sets a specific led in the buffer.- Parameters:
index- the index to writer- the r value [0-255]g- the g value [0-255]b- the b value [0-255]
-
setHSV
Sets a specific led in the buffer.- Parameters:
index- the index to writeh- the h value [0-180]s- the s value [0-255]v- the v value [0-255]
-
setLED
Sets a specific LED in the buffer.- Parameters:
index- The index to writecolor- The color of the LED
-
setLED
Sets a specific LED in the buffer.- Parameters:
index- The index to writecolor- The color of the LED
-
getLength
Gets the buffer length.- Returns:
- the buffer length
-
getLED8Bit
Gets the color at the specified index.- Parameters:
index- the index to get- Returns:
- the LED color at the specified index
-
getLED
Gets the color at the specified index.- Parameters:
index- the index to get- Returns:
- the LED color at the specified index
-