Class to control a simulated addressable LED.
More...
#include <frc/simulation/AddressableLEDSim.h>
Class to control a simulated addressable LED.
◆ AddressableLEDSim() [1/2]
frc::sim::AddressableLEDSim::AddressableLEDSim |
( |
| ) |
|
Constructs for the first addressable LED.
◆ AddressableLEDSim() [2/2]
frc::sim::AddressableLEDSim::AddressableLEDSim |
( |
const AddressableLED & | addressableLED | ) |
|
|
explicit |
◆ CreateForChannel()
static AddressableLEDSim frc::sim::AddressableLEDSim::CreateForChannel |
( |
int | pwmChannel | ) |
|
|
static |
◆ CreateForIndex()
◆ GetData()
Get the LED data.
- Parameters
-
data | output parameter to fill with LED data |
- Returns
- the length of the LED data
◆ GetInitialized()
bool frc::sim::AddressableLEDSim::GetInitialized |
( |
| ) |
const |
Check if initialized.
- Returns
- true if initialized
◆ GetLength()
int frc::sim::AddressableLEDSim::GetLength |
( |
| ) |
const |
Get the length of the LED strip.
- Returns
- the length
◆ GetOutputPort()
int frc::sim::AddressableLEDSim::GetOutputPort |
( |
| ) |
const |
Get the output port.
- Returns
- the output port
◆ GetRunning()
int frc::sim::AddressableLEDSim::GetRunning |
( |
| ) |
const |
Check if the LEDs are running.
- Returns
- true if they are
◆ RegisterDataCallback()
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()
std::unique_ptr< CallbackStore > frc::sim::AddressableLEDSim::RegisterInitializedCallback |
( |
NotifyCallback | callback, |
|
|
bool | initialNotify ) |
|
nodiscard |
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()
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
◆ RegisterOutputPortCallback()
std::unique_ptr< CallbackStore > frc::sim::AddressableLEDSim::RegisterOutputPortCallback |
( |
NotifyCallback | callback, |
|
|
bool | initialNotify ) |
|
nodiscard |
Register a callback on the output port.
- Parameters
-
callback | the callback that will be called whenever the output port is changed |
initialNotify | if true, the callback will be run on the initial value |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterRunningCallback()
Register a callback on whether the LEDs are running.
- Parameters
-
callback | the callback that will be called whenever the LED state is changed |
initialNotify | if true, the callback will be run on the initial value |
- Returns
- the CallbackStore object associated with this callback
◆ SetData()
Change the LED data.
- Parameters
-
data | the new data |
length | the length of the LED data |
◆ SetInitialized()
void frc::sim::AddressableLEDSim::SetInitialized |
( |
bool | initialized | ) |
|
Change the Initialized value of the LED strip.
- Parameters
-
◆ SetLength()
void frc::sim::AddressableLEDSim::SetLength |
( |
int | length | ) |
|
Change the length of the LED strip.
- Parameters
-
◆ SetOutputPort()
void frc::sim::AddressableLEDSim::SetOutputPort |
( |
int | outputPort | ) |
|
Change the output port.
- Parameters
-
outputPort | the new output port |
◆ SetRunning()
void frc::sim::AddressableLEDSim::SetRunning |
( |
bool | running | ) |
|
Change whether the LEDs are active.
- Parameters
-
The documentation for this class was generated from the following file: