AddressableLEDBuffer

class wpilib.AddressableLEDBuffer(length: SupportsInt | SupportsIndex)

Bases: pybind11_object

Buffer storage for Addressable LEDs.

Constructs a new LED buffer with the specified length.

Parameters:

length – The length of the buffer in pixels

class View

Bases: pybind11_object

A view of another addressable LED buffer. Views provide an easy way to split a large LED strip into smaller sections that can be animated individually.

getLED(index: SupportsInt | SupportsIndex) wpiutil._wpiutil.Color

Gets the color at the specified index.

Parameters:

index – the index

Returns:

the LED color

getLED8Bit(index: SupportsInt | SupportsIndex) wpiutil._wpiutil.Color8Bit

Gets the color at the specified index.

Parameters:

index – the index

Returns:

the LED color

setHSV(index: SupportsInt | SupportsIndex, h: SupportsInt | SupportsIndex, s: SupportsInt | SupportsIndex, v: SupportsInt | SupportsIndex) None

Sets a specific LED in the view.

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(*args, **kwargs)

Overloaded function.

  1. setLED(self: wpilib._wpilib.AddressableLEDBuffer.View, index: typing.SupportsInt | typing.SupportsIndex, color: wpiutil._wpiutil.Color) -> None

Sets a specific LED in the view.

Parameters:
  • index – the index to write

  • color – the color to write

  1. setLED(self: wpilib._wpilib.AddressableLEDBuffer.View, index: typing.SupportsInt | typing.SupportsIndex, color: wpiutil._wpiutil.Color8Bit) -> None

Sets a specific LED in the view.

Parameters:
  • index – the index to write

  • color – the color to write

setRGB(index: SupportsInt | SupportsIndex, r: SupportsInt | SupportsIndex, g: SupportsInt | SupportsIndex, b: SupportsInt | SupportsIndex) None

Sets a specific LED in the view.

Parameters:
  • index – the index to write

  • r – the r value [0-255]

  • g – the g value [0-255]

  • b – the b value [0-255]

getBlue(index: SupportsInt | SupportsIndex) int

Gets the blue value at the specified index.

Parameters:

index – the index

Returns:

the blue value

getGreen(index: SupportsInt | SupportsIndex) int

Gets the green value at the specified index.

Parameters:

index – the index

Returns:

the green value

getLED(index: SupportsInt | SupportsIndex) wpiutil._wpiutil.Color

Gets the color at the specified index.

Parameters:

index – the index

Returns:

the LED color

getLED8Bit(index: SupportsInt | SupportsIndex) wpiutil._wpiutil.Color8Bit

Gets the color at the specified index.

Parameters:

index – the index

Returns:

the LED color

getRed(index: SupportsInt | SupportsIndex) int

Gets the red value at the specified index.

Parameters:

index – the index

Returns:

the red value

setHSV(index: SupportsInt | SupportsIndex, h: SupportsInt | SupportsIndex, s: SupportsInt | SupportsIndex, v: SupportsInt | SupportsIndex) None

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(*args, **kwargs)

Overloaded function.

  1. setLED(self: wpilib._wpilib.AddressableLEDBuffer, index: typing.SupportsInt | typing.SupportsIndex, color: wpiutil._wpiutil.Color) -> None

Sets a specific LED in the buffer.

Parameters:
  • index – the index to write

  • color – the color to write

  1. setLED(self: wpilib._wpilib.AddressableLEDBuffer, index: typing.SupportsInt | typing.SupportsIndex, color: wpiutil._wpiutil.Color8Bit) -> None

Sets a specific LED in the buffer.

Parameters:
  • index – the index to write

  • color – the color to write

setRGB(index: SupportsInt | SupportsIndex, r: SupportsInt | SupportsIndex, g: SupportsInt | SupportsIndex, b: SupportsInt | SupportsIndex) None

Sets a specific LED in the buffer.

Parameters:
  • index – the index to write

  • r – the r value [0-255]

  • g – the g value [0-255]

  • b – the b value [0-255]