WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::UpDownCounter Class Reference

Up Down Counter. More...

#include <wpi/counter/UpDownCounter.hpp>

Inheritance diagram for wpi::UpDownCounter:
wpi::util::Sendable wpi::util::SendableHelper< UpDownCounter >

Public Member Functions

 UpDownCounter (int channel, EdgeConfiguration configuration)
 Constructs a new UpDown Counter.
 UpDownCounter (UpDownCounter &&)=default
UpDownCounteroperator= (UpDownCounter &&)=default
 ~UpDownCounter () override=default
int GetCount () const
 Gets the current count.
void Reset ()
 Resets the current count.
void SetEdgeConfiguration (EdgeConfiguration configuration)
 Sets the configuration for the channel.
Public Member Functions inherited from wpi::util::Sendable
virtual constexpr ~Sendable ()=default
Public Member Functions inherited from wpi::util::SendableHelper< UpDownCounter >
constexpr SendableHelper (const SendableHelper &rhs)=default
constexpr SendableHelperoperator= (const SendableHelper &rhs)=default

Protected Member Functions

void InitSendable (wpi::util::SendableBuilder &builder) override
 Initializes this Sendable object.
Protected Member Functions inherited from wpi::util::SendableHelper< UpDownCounter >
constexpr ~SendableHelper ()

Detailed Description

Up Down Counter.

This class can count edges on a single digital input or count up based on an edge from one digital input and down on an edge from another digital input.

Constructor & Destructor Documentation

◆ UpDownCounter() [1/2]

wpi::UpDownCounter::UpDownCounter ( int channel,
EdgeConfiguration configuration )

Constructs a new UpDown Counter.

Parameters
channelThe DIO channel
configurationEdge configuration

◆ UpDownCounter() [2/2]

wpi::UpDownCounter::UpDownCounter ( UpDownCounter && )
default

◆ ~UpDownCounter()

wpi::UpDownCounter::~UpDownCounter ( )
overridedefault

Member Function Documentation

◆ GetCount()

int wpi::UpDownCounter::GetCount ( ) const

Gets the current count.

Returns
The current count.

◆ InitSendable()

void wpi::UpDownCounter::InitSendable ( wpi::util::SendableBuilder & builder)
overrideprotectedvirtual

Initializes this Sendable object.

Parameters
buildersendable builder

Implements wpi::util::Sendable.

◆ operator=()

UpDownCounter & wpi::UpDownCounter::operator= ( UpDownCounter && )
default

◆ Reset()

void wpi::UpDownCounter::Reset ( )

Resets the current count.

◆ SetEdgeConfiguration()

void wpi::UpDownCounter::SetEdgeConfiguration ( EdgeConfiguration configuration)

Sets the configuration for the channel.

Parameters
configurationThe channel configuration.

The documentation for this class was generated from the following file: