AddressableLEDSim

class wpilib.simulation.AddressableLEDSim(*args, **kwargs)

Bases: pybind11_object

Class to control a simulated addressable LED.

Overloaded function.

  1. __init__(self: wpilib.simulation._simulation.AddressableLEDSim, channel: typing.SupportsInt | typing.SupportsIndex) -> None

Constructs an addressable LED for a specific channel.

Parameters:

channel – output channel

  1. __init__(self: wpilib.simulation._simulation.AddressableLEDSim, addressableLED: wpilib._wpilib.AddressableLED) -> None

Constructs from an AddressableLED object.

Parameters:

addressableLED – AddressableLED to simulate

getData() list[wpilib._wpilib.AddressableLED.LEDData]

Get the LED data.

Parameters:

data – output parameter to fill with LED data

Returns:

the length of the LED data

getInitialized() bool

Check if initialized.

Returns:

true if initialized

getLength() int

Get the length of the LED strip.

Returns:

the length

getStart() int

Get the start.

Returns:

the start

static registerDataCallback(callback: collections.abc.Callable[[str, SupportsInt | SupportsIndex, SupportsInt | SupportsIndex], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback on the LED data.

Parameters:
  • callback – the callback that will be called whenever the LED data is changed

  • initialNotify – if true, the callback will be run on the initial value

Returns:

the CallbackStore object associated with this callback

registerInitializedCallback(callback: collections.abc.Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback on the Initialized property.

Parameters:
  • callback – the callback that will be called whenever the Initialized property is changed

  • initialNotify – if true, the callback will be run on the initial value

Returns:

the CallbackStore object storing this callback

registerLengthCallback(callback: collections.abc.Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback on the length.

Parameters:
  • callback – the callback that will be called whenever the length is changed

  • initialNotify – if true, the callback will be run on the initial value

Returns:

the CallbackStore object associated with this callback

registerStartCallback(callback: collections.abc.Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback on the start.

Parameters:
  • callback – the callback that will be called whenever the start is changed

  • initialNotify – if true, the callback will be run on the initial value

Returns:

the CallbackStore object associated with this callback

setData(data: List[wpilib._wpilib.AddressableLED.LEDData]) None

Change the LED data.

Parameters:

data – the new data

setInitialized(initialized: bool) None

Change the Initialized value of the LED strip.

Parameters:

initialized – the new value

setLength(length: SupportsInt | SupportsIndex) None

Change the length of the LED strip.

Parameters:

length – the new value

setStart(start: SupportsInt | SupportsIndex) None

Change the start.

Parameters:

start – the new start