CounterBase

class wpilib.interfaces.CounterBase(self: wpilib.interfaces.CounterBase) → None

Bases: pybind11_builtins.pybind11_object

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.

class EncodingType(self: wpilib.interfaces._interfaces.CounterBase.EncodingType, value: int) → None

Bases: pybind11_builtins.pybind11_object

Members:

k1X

k2X

k4X

k1X = <EncodingType.k1X: 0>
k2X = <EncodingType.k2X: 1>
k4X = <EncodingType.k4X: 2>
property name
get(self: wpilib.interfaces.CounterBase) → int
getDirection(self: wpilib.interfaces.CounterBase) → bool
getPeriod(self: wpilib.interfaces.CounterBase) → float
getStopped(self: wpilib.interfaces.CounterBase) → bool
reset(self: wpilib.interfaces.CounterBase) → None
setMaxPeriod(self: wpilib.interfaces.CounterBase, maxPeriod: float) → None