WPILibC++  2019.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
frc::CounterBase Class Referenceabstract

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

#include <CounterBase.h>

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

Public Types

enum  EncodingType { k1X, k2X, k4X }
 

Public Member Functions

 CounterBase (CounterBase &&)=default
 
CounterBaseoperator= (CounterBase &&)=default
 
virtual int Get () const =0
 
virtual void Reset ()=0
 
virtual double GetPeriod () const =0
 
virtual void SetMaxPeriod (double 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.


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