WPILibC++ 2024.3.2
frc::CounterBase Class Referenceabstract

Interface for counting the number of ticks on a digital input channel. More...

#include <frc/CounterBase.h>

Inheritance diagram for frc::CounterBase:
frc::Counter frc::Encoder

Public Types

enum  EncodingType { k1X , k2X , k4X }
 

Public Member Functions

 CounterBase ()=default
 
virtual ~CounterBase ()=default
 
 CounterBase (CounterBase &&)=default
 
CounterBaseoperator= (CounterBase &&)=default
 
virtual int Get () const =0
 
virtual void Reset ()=0
 
virtual units::second_t GetPeriod () const =0
 
virtual void SetMaxPeriod (units::second_t maxPeriod)=0
 
virtual bool GetStopped () const =0
 
virtual bool GetDirection () const =0
 

Detailed Description

Interface for counting the number of ticks on a digital input channel.

Encoders, Gear tooth sensors, and counters should all subclass this so it can be used to build more advanced classes for control and driving.

All counters will immediately start counting - Reset() them if you need them to be zeroed before use.

Member Enumeration Documentation

◆ EncodingType

Enumerator
k1X 
k2X 
k4X 

Constructor & Destructor Documentation

◆ CounterBase() [1/2]

frc::CounterBase::CounterBase ( )
default

◆ ~CounterBase()

virtual frc::CounterBase::~CounterBase ( )
virtualdefault

◆ CounterBase() [2/2]

frc::CounterBase::CounterBase ( CounterBase &&  )
default

Member Function Documentation

◆ Get()

virtual int frc::CounterBase::Get ( ) const
pure virtual

Implemented in frc::Counter, and frc::Encoder.

◆ GetDirection()

virtual bool frc::CounterBase::GetDirection ( ) const
pure virtual

Implemented in frc::Counter, and frc::Encoder.

◆ GetPeriod()

virtual units::second_t frc::CounterBase::GetPeriod ( ) const
pure virtual

Implemented in frc::Counter, and frc::Encoder.

◆ GetStopped()

virtual bool frc::CounterBase::GetStopped ( ) const
pure virtual

Implemented in frc::Counter, and frc::Encoder.

◆ operator=()

CounterBase & frc::CounterBase::operator= ( CounterBase &&  )
default

◆ Reset()

virtual void frc::CounterBase::Reset ( )
pure virtual

Implemented in frc::Counter, and frc::Encoder.

◆ SetMaxPeriod()

virtual void frc::CounterBase::SetMaxPeriod ( units::second_t  maxPeriod)
pure virtual

Implemented in frc::Counter, and frc::Encoder.


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