Class to control a simulated analog input.
More...
#include <frc/simulation/AnalogInputSim.h>
Class to control a simulated analog input.
◆ AnalogInputSim() [1/2]
frc::sim::AnalogInputSim::AnalogInputSim |
( |
const AnalogInput & | analogInput | ) |
|
|
explicit |
◆ AnalogInputSim() [2/2]
frc::sim::AnalogInputSim::AnalogInputSim |
( |
int | channel | ) |
|
|
explicit |
Constructs from an analog input channel number.
- Parameters
-
◆ GetAverageBits()
int frc::sim::AnalogInputSim::GetAverageBits |
( |
| ) |
const |
Get the number of average bits.
- Returns
- the number of average bits
◆ GetInitialized()
bool frc::sim::AnalogInputSim::GetInitialized |
( |
| ) |
const |
Check if this analog input has been initialized.
- Returns
- true if initialized
◆ GetOversampleBits()
int frc::sim::AnalogInputSim::GetOversampleBits |
( |
| ) |
const |
Get the amount of oversampling bits.
- Returns
- the amount of oversampling bits
◆ GetVoltage()
double frc::sim::AnalogInputSim::GetVoltage |
( |
| ) |
const |
Get the voltage.
- Returns
- the voltage
◆ RegisterAverageBitsCallback()
Register a callback on the number of average bits.
- Parameters
-
callback | the callback that will be called whenever the number of average bits is changed |
initialNotify | if true, the callback will be run on the initial value |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterInitializedCallback()
Register a callback on whether the analog input is initialized.
- Parameters
-
callback | the callback that will be called whenever the analog input is initialized |
initialNotify | if true, the callback will be run on the initial value |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterOversampleBitsCallback()
std::unique_ptr< CallbackStore > frc::sim::AnalogInputSim::RegisterOversampleBitsCallback |
( |
NotifyCallback | callback, |
|
|
bool | initialNotify ) |
|
nodiscard |
Register a callback on the amount of oversampling bits.
- Parameters
-
callback | the callback that will be called whenever the oversampling bits are changed |
initialNotify | if true, the callback will be run on the initial value |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterVoltageCallback()
Register a callback on the voltage.
- Parameters
-
callback | the callback that will be called whenever the voltage is changed |
initialNotify | if true, the callback will be run on the initial value |
- Returns
- the CallbackStore object associated with this callback
◆ ResetData()
void frc::sim::AnalogInputSim::ResetData |
( |
| ) |
|
Reset all simulation data for this object.
◆ SetAverageBits()
void frc::sim::AnalogInputSim::SetAverageBits |
( |
int | averageBits | ) |
|
Change the number of average bits.
- Parameters
-
◆ SetInitialized()
void frc::sim::AnalogInputSim::SetInitialized |
( |
bool | initialized | ) |
|
Change whether this analog input has been initialized.
- Parameters
-
◆ SetOversampleBits()
void frc::sim::AnalogInputSim::SetOversampleBits |
( |
int | oversampleBits | ) |
|
Change the amount of oversampling bits.
- Parameters
-
oversampleBits | the new value |
◆ SetVoltage()
void frc::sim::AnalogInputSim::SetVoltage |
( |
double | voltage | ) |
|
Change the voltage.
- Parameters
-
The documentation for this class was generated from the following file: