WPILibC++ 2023.4.3
|
Class to read a digital input. More...
#include <frc/DigitalInput.h>
Public Member Functions | |
DigitalInput (int channel) | |
Create an instance of a Digital Input class. More... | |
~DigitalInput () override | |
DigitalInput (DigitalInput &&)=default | |
DigitalInput & | operator= (DigitalInput &&)=default |
bool | Get () const |
Get the value from a digital input channel. More... | |
HAL_Handle | GetPortHandleForRouting () const override |
AnalogTriggerType | GetAnalogTriggerTypeForRouting () const override |
bool | IsAnalogTrigger () const override |
Is source an AnalogTrigger. More... | |
int | GetChannel () const override |
void | SetSimDevice (HAL_SimDeviceHandle device) |
Indicates this input is used by a simulated device. More... | |
void | InitSendable (wpi::SendableBuilder &builder) override |
Initializes this Sendable object. More... | |
Public Member Functions inherited from frc::DigitalSource | |
DigitalSource ()=default | |
DigitalSource (DigitalSource &&)=default | |
DigitalSource & | operator= (DigitalSource &&)=default |
virtual HAL_Handle | GetPortHandleForRouting () const =0 |
virtual AnalogTriggerType | GetAnalogTriggerTypeForRouting () const =0 |
virtual bool | IsAnalogTrigger () const =0 |
virtual int | GetChannel () const =0 |
Public Member Functions inherited from wpi::Sendable | |
virtual | ~Sendable ()=default |
virtual void | InitSendable (SendableBuilder &builder)=0 |
Initializes this Sendable object. More... | |
Public Member Functions inherited from wpi::SendableHelper< DigitalInput > | |
SendableHelper (const SendableHelper &rhs)=default | |
SendableHelper (SendableHelper &&rhs) | |
SendableHelper & | operator= (const SendableHelper &rhs)=default |
SendableHelper & | operator= (SendableHelper &&rhs) |
Friends | |
class | DigitalGlitchFilter |
Additional Inherited Members | |
Protected Member Functions inherited from wpi::SendableHelper< DigitalInput > | |
SendableHelper ()=default | |
~SendableHelper () | |
Class to read a digital input.
This class will read digital inputs and return the current value on the channel. Other devices such as encoders, gear tooth sensors, etc. that are implemented elsewhere will automatically allocate digital inputs and outputs as required. This class is only for devices like switches etc. that aren't implemented anywhere else.
|
explicit |
Create an instance of a Digital Input class.
Creates a digital input given a channel.
channel | The DIO channel 0-9 are on-board, 10-25 are on the MXP port |
|
override |
|
default |
bool frc::DigitalInput::Get | ( | ) | const |
Get the value from a digital input channel.
Retrieve the value of a single digital input channel from the FPGA.
|
overridevirtual |
Implements frc::DigitalSource.
|
overridevirtual |
Implements frc::DigitalSource.
|
overridevirtual |
Implements frc::DigitalSource.
|
overridevirtual |
|
overridevirtual |
Is source an AnalogTrigger.
Implements frc::DigitalSource.
|
default |
void frc::DigitalInput::SetSimDevice | ( | HAL_SimDeviceHandle | device | ) |
Indicates this input is used by a simulated device.
device | simulated device handle |
|
friend |