public class GearTooth extends Counter
Counter.Mode
CounterBase.EncodingType
m_downSource, m_upSource
Constructor and Description |
---|
GearTooth(DigitalSource source)
Construct a GearTooth sensor given a digital input.
|
GearTooth(DigitalSource source,
boolean directionSensitive)
Construct a GearTooth sensor given a digital input.
|
GearTooth(int channel)
Construct a GearTooth sensor given a channel.
|
GearTooth(int channel,
boolean directionSensitive)
Construct a GearTooth sensor given a channel.
|
Modifier and Type | Method and Description |
---|---|
void |
enableDirectionSensing(boolean directionSensitive)
Common code called by the constructors.
|
void |
initSendable(SendableBuilder builder)
Initializes this
Sendable object. |
clearDownSource, clearUpSource, close, get, getDirection, getDistance, getFPGAIndex, getPeriod, getPIDSourceType, getRate, getSamplesToAverage, getStopped, pidGet, reset, setDistancePerPulse, setDownSource, setDownSource, setDownSource, setDownSourceEdge, setExternalDirectionMode, setMaxPeriod, setPIDSourceType, setPulseLengthMode, setReverseDirection, setSamplesToAverage, setSemiPeriodMode, setUpdateWhenEmpty, setUpDownCounterMode, setUpSource, setUpSource, setUpSource, setUpSourceEdge
addChild, free, getName, getSubsystem, setName, setName, setName, setSubsystem
public GearTooth(int channel)
No direction sensing is assumed.
channel
- The GPIO channel that the sensor is connected to.public GearTooth(int channel, boolean directionSensitive)
channel
- The DIO channel that the sensor is connected to. 0-9 are on-board,
10-25 are on the MXP portdirectionSensitive
- True to enable the pulse length decoding in hardware to specify count
direction.public GearTooth(DigitalSource source, boolean directionSensitive)
source
- An existing DigitalSource object (such as a DigitalInput)directionSensitive
- True to enable the pulse length decoding in hardware to specify count
direction.public GearTooth(DigitalSource source)
No direction sensing is assumed.
source
- An object that fully describes the input that the sensor is connected to.public void enableDirectionSensing(boolean directionSensitive)
public void initSendable(SendableBuilder builder)
Sendable
Sendable
object.initSendable
in interface Sendable
initSendable
in class Counter
builder
- sendable builder