![]() |
WPILibC++ 2025.3.2
|
Counter using external direction. More...
#include <frc/counter/ExternalDirectionCounter.h>
Public Member Functions | |
| ExternalDirectionCounter (DigitalSource &countSource, DigitalSource &directionSource) | |
| Constructs a new ExternalDirectionCounter. | |
| ExternalDirectionCounter (std::shared_ptr< DigitalSource > countSource, std::shared_ptr< DigitalSource > directionSource) | |
| Constructs a new ExternalDirectionCounter. | |
| ExternalDirectionCounter (ExternalDirectionCounter &&)=default | |
| ExternalDirectionCounter & | operator= (ExternalDirectionCounter &&)=default |
| ~ExternalDirectionCounter () override=default | |
| int | GetCount () const |
| Gets the current count. | |
| void | SetReverseDirection (bool reverseDirection) |
| Sets to reverse the counter direction. | |
| void | Reset () |
| Resets the current count. | |
| void | SetEdgeConfiguration (EdgeConfiguration configuration) |
| Sets the edge configuration for counting. | |
Public Member Functions inherited from wpi::Sendable | |
| virtual constexpr | ~Sendable ()=default |
Public Member Functions inherited from wpi::SendableHelper< ExternalDirectionCounter > | |
| 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< ExternalDirectionCounter > | |
| constexpr | SendableHelper ()=default |
| constexpr | ~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. |
|
default |
|
overridedefault |
| 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. |