CounterBase
- class wpilib.CounterBase
Bases:
pybind11_objectInterface 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(value: SupportsInt | SupportsIndex)
Bases:
pybind11_objectThe number of edges for the CounterBase to increment or decrement on.
Members:
X1
X2
X4
- X1 = <EncodingType.X1: 0>
- X2 = <EncodingType.X2: 1>
- X4 = <EncodingType.X4: 2>
- CounterBase.EncodingType.name -> str
- property value
- get() int
- getDirection() bool
- getPeriod() wpimath.units.seconds
- getStopped() bool
- reset() None
- setMaxPeriod(maxPeriod: wpimath.units.seconds) None