WPILibC++ 2023.4.3-108-ge5452e3
|
Counter using external direction. More...
#include <frc/counter/ExternalDirectionCounter.h>
Public Member Functions | |
ExternalDirectionCounter (DigitalSource &countSource, DigitalSource &directionSource) | |
Constructs a new ExternalDirectionCounter. More... | |
ExternalDirectionCounter (std::shared_ptr< DigitalSource > countSource, std::shared_ptr< DigitalSource > directionSource) | |
Constructs a new ExternalDirectionCounter. More... | |
~ExternalDirectionCounter () override | |
ExternalDirectionCounter (ExternalDirectionCounter &&)=default | |
ExternalDirectionCounter & | operator= (ExternalDirectionCounter &&)=default |
int | GetCount () const |
Gets the current count. More... | |
void | SetReverseDirection (bool reverseDirection) |
Sets to reverse the counter direction. More... | |
void | Reset () |
Resets the current count. More... | |
void | SetEdgeConfiguration (EdgeConfiguration configuration) |
Sets the edge configuration for counting. More... | |
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< ExternalDirectionCounter > | |
SendableHelper (const SendableHelper &rhs)=default | |
SendableHelper (SendableHelper &&rhs) | |
SendableHelper & | operator= (const SendableHelper &rhs)=default |
SendableHelper & | operator= (SendableHelper &&rhs) |
Protected Member Functions | |
void | InitSendable (wpi::SendableBuilder &builder) override |
Initializes this Sendable object. More... | |
Protected Member Functions inherited from wpi::SendableHelper< ExternalDirectionCounter > | |
SendableHelper ()=default | |
~SendableHelper () | |
Counter using external direction.
This counts on an edge from one digital input and the whether it counts up or down based on the state of a second digital input.
frc::ExternalDirectionCounter::ExternalDirectionCounter | ( | DigitalSource & | countSource, |
DigitalSource & | directionSource | ||
) |
Constructs a new ExternalDirectionCounter.
countSource | The source for counting. |
directionSource | The source for selecting count direction. |
frc::ExternalDirectionCounter::ExternalDirectionCounter | ( | std::shared_ptr< DigitalSource > | countSource, |
std::shared_ptr< DigitalSource > | directionSource | ||
) |
Constructs a new ExternalDirectionCounter.
countSource | The source for counting. |
directionSource | The source for selecting count direction. |
|
override |
|
default |
int frc::ExternalDirectionCounter::GetCount | ( | ) | const |
Gets the current count.
|
overrideprotectedvirtual |
|
default |
void frc::ExternalDirectionCounter::Reset | ( | ) |
Resets the current count.
void frc::ExternalDirectionCounter::SetEdgeConfiguration | ( | EdgeConfiguration | configuration | ) |
Sets the edge configuration for counting.
configuration | The counting edge configuration. |
void frc::ExternalDirectionCounter::SetReverseDirection | ( | bool | reverseDirection | ) |
Sets to reverse the counter direction.
reverseDirection | True to reverse counting direction. |