Class to control a simulated duty cycle digital input.
More...
#include <frc/simulation/DutyCycleSim.h>
Class to control a simulated duty cycle digital input.
◆ DutyCycleSim()
frc::sim::DutyCycleSim::DutyCycleSim |
( |
const DutyCycle & | dutyCycle | ) |
|
|
explicit |
Constructs from a DutyCycle object.
- Parameters
-
◆ CreateForChannel()
static DutyCycleSim frc::sim::DutyCycleSim::CreateForChannel |
( |
int | channel | ) |
|
|
static |
Creates a DutyCycleSim for a SmartIO channel.
- Parameters
-
- Returns
- Simulated object
◆ GetFrequency()
units::hertz_t frc::sim::DutyCycleSim::GetFrequency |
( |
| ) |
const |
Measure the frequency.
- Returns
- the duty cycle frequency
◆ GetInitialized()
bool frc::sim::DutyCycleSim::GetInitialized |
( |
| ) |
const |
Check whether this duty cycle input has been initialized.
- Returns
- true if initialized
◆ GetOutput()
double frc::sim::DutyCycleSim::GetOutput |
( |
| ) |
const |
Measure the output from this duty cycle port.
- Returns
- the output value
◆ RegisterFrequencyCallback()
Register a callback to be run whenever the frequency changes.
- Parameters
-
callback | the callback |
initialNotify | whether to call the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterInitializedCallback()
Register a callback to be run when this duty cycle input is initialized.
- Parameters
-
callback | the callback |
initialNotify | whether to run the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterOutputCallback()
Register a callback to be run whenever the output changes.
- Parameters
-
callback | the callback |
initialNotify | whether to call the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ ResetData()
void frc::sim::DutyCycleSim::ResetData |
( |
| ) |
|
Reset all simulation data for the duty cycle output.
◆ SetFrequency()
void frc::sim::DutyCycleSim::SetFrequency |
( |
units::hertz_t | frequency | ) |
|
Change the duty cycle frequency.
- Parameters
-
frequency | the new frequency |
◆ SetInitialized()
void frc::sim::DutyCycleSim::SetInitialized |
( |
bool | initialized | ) |
|
Define whether this duty cycle input has been initialized.
- Parameters
-
initialized | whether this object is initialized |
◆ SetOutput()
void frc::sim::DutyCycleSim::SetOutput |
( |
double | output | ) |
|
Change the duty cycle output.
- Parameters
-
output | the new output value |
The documentation for this class was generated from the following file: