![]() |
WPILibC++ 2027.0.0-alpha-3
|
Class to read a duty cycle PWM input. More...
#include <frc/DutyCycle.h>
Public Member Functions | |
| DutyCycle (int source) | |
| Constructs a DutyCycle input from a smartio channel. | |
| DutyCycle (DutyCycle &&)=default | |
| DutyCycle & | operator= (DutyCycle &&)=default |
| ~DutyCycle () override=default | |
| Close the DutyCycle and free all resources. | |
| units::hertz_t | GetFrequency () const |
| Get the frequency of the duty cycle signal. | |
| double | GetOutput () const |
| Get the output ratio of the duty cycle signal. | |
| units::second_t | GetHighTime () const |
| Get the raw high time of the duty cycle signal. | |
| int | GetSourceChannel () const |
| Get the channel of the source. | |
Public Member Functions inherited from wpi::Sendable | |
| virtual constexpr | ~Sendable ()=default |
Public Member Functions inherited from wpi::SendableHelper< DutyCycle > | |
| constexpr | SendableHelper (const SendableHelper &rhs)=default |
| constexpr | SendableHelper (SendableHelper &&rhs) |
| constexpr SendableHelper & | operator= (const SendableHelper &rhs)=default |
| constexpr SendableHelper & | operator= (SendableHelper &&rhs) |
Protected Member Functions | |
| void | InitSendable (wpi::SendableBuilder &builder) override |
| Initializes this Sendable object. | |
Protected Member Functions inherited from wpi::SendableHelper< DutyCycle > | |
| constexpr | SendableHelper ()=default |
| constexpr | ~SendableHelper () |
Class to read a duty cycle PWM input.
PWM input signals are specified with a frequency and a ratio of high to low in that frequency. These can be attached to any SmartIO.
|
explicit |
Constructs a DutyCycle input from a smartio channel.
| source | The channel to use. |
|
default |
|
overridedefault |
Close the DutyCycle and free all resources.
| units::hertz_t frc::DutyCycle::GetFrequency | ( | ) | const |
Get the frequency of the duty cycle signal.
| units::second_t frc::DutyCycle::GetHighTime | ( | ) | const |
Get the raw high time of the duty cycle signal.
| double frc::DutyCycle::GetOutput | ( | ) | const |
Get the output ratio of the duty cycle signal.
0 means always low, 1 means always high.
| int frc::DutyCycle::GetSourceChannel | ( | ) | const |
Get the channel of the source.
|
overrideprotectedvirtual |