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, addressable_led: wpilib._wpilib.AddressableLED) -> None

Constructs from an AddressableLED object.

Parameters:

addressable_led – AddressableLED to simulate

get_data() 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

get_initialized() bool

Check if initialized.

Returns:

true if initialized

get_length() int

Get the length of the LED strip.

Returns:

the length

get_start() int

Get the start.

Returns:

the start

static register_data_callback(callback: collections.abc.Callable[[str, SupportsInt | SupportsIndex, SupportsInt | SupportsIndex], None], initial_notify: 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

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

Returns:

the CallbackStore object associated with this callback

register_initialized_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: 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

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

Returns:

the CallbackStore object storing this callback

register_length_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback on the length.

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

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

Returns:

the CallbackStore object associated with this callback

register_start_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback on the start.

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

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

Returns:

the CallbackStore object associated with this callback

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

Change the LED data.

Parameters:

data – the new data

set_initialized(initialized: bool) None

Change the Initialized value of the LED strip.

Parameters:

initialized – the new value

set_length(length: SupportsInt | SupportsIndex) None

Change the length of the LED strip.

Parameters:

length – the new value

set_start(start: SupportsInt | SupportsIndex) None

Change the start.

Parameters:

start – the new start