"

2013 FRC Java API

"

edu.wpi.first.wpilibj
Class GearTooth

java.lang.Object
  extended by edu.wpi.first.wpilibj.SensorBase
      extended by edu.wpi.first.wpilibj.Counter
          extended by edu.wpi.first.wpilibj.GearTooth
All Implemented Interfaces:
CounterBase, LiveWindowSendable, IDevice, ISensor, PIDSource, Sendable

public class GearTooth
extends Counter
implements ISensor

Alias for counter class. Implement the gear tooth sensor supplied by FIRST. Currently there is no reverse sensing on the gear tooth sensor, but in future versions we might implement the necessary timing in the FPGA to sense direction.


Nested Class Summary
 
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj.Counter
Counter.Mode
 
Nested classes/interfaces inherited from interface edu.wpi.first.wpilibj.CounterBase
CounterBase.EncodingType
 
Nested classes/interfaces inherited from interface edu.wpi.first.wpilibj.PIDSource
PIDSource.PIDSourceParameter
 
Field Summary
 
Fields inherited from class edu.wpi.first.wpilibj.SensorBase
kAnalogChannels, kAnalogModules, kDigitalChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond
 
Constructor Summary
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.
GearTooth(int slot, int channel)
          Construct a GearTooth sensor given a channel and module.
GearTooth(int slot, int channel, boolean directionSensitive)
          Construct a GearTooth sensor given a channel and module.
 
Method Summary
 void enableDirectionSensing(boolean directionSensitive)
          Common code called by the constructors.
 String getSmartDashboardType()
          Live Window code, only does anything if live window is activated.
 
Methods inherited from class edu.wpi.first.wpilibj.Counter
clearDownSource, clearUpSource, free, get, getDirection, getDistance, getPeriod, getRate, getSamplesToAverage, getStopped, getTable, initTable, pidGet, reset, setDistancePerPulse, setDownSource, setDownSource, setDownSource, setDownSource, setDownSourceEdge, setExternalDirectionMode, setMaxPeriod, setPIDSourceParameter, setPulseLengthMode, setReverseDirection, setSamplesToAverage, setSemiPeriodMode, setUpdateWhenEmpty, setUpDownCounterMode, setUpSource, setUpSource, setUpSource, setUpSource, setUpSourceEdge, start, startLiveWindowMode, stop, stopLiveWindowMode, updateTable
 
Methods inherited from class edu.wpi.first.wpilibj.SensorBase
checkAnalogChannel, checkAnalogModule, checkDigitalChannel, checkDigitalModule, checkPWMChannel, checkPWMModule, checkRelayChannel, checkRelayModule, checkSolenoidChannel, checkSolenoidModule, getDefaultAnalogModule, getDefaultDigitalModule, getDefaultSolenoidModule, setDefaultAnalogModule, setDefaultDigitalModule, setDefaultSolenoidModule
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GearTooth

public GearTooth(int channel,
                 boolean directionSensitive)
Construct a GearTooth sensor given a channel. The default module is assumed.

Parameters:
channel - The GPIO channel on the digital module that the sensor is connected to.
directionSensitive - Enable the pulse length decoding in hardware to specify count direction.

GearTooth

public GearTooth(int channel)
Construct a GearTooth sensor given a channel. The default module is assumed. No direction sensing is assumed.

Parameters:
channel - The GPIO channel on the digital module that the sensor is connected to.

GearTooth

public GearTooth(int slot,
                 int channel,
                 boolean directionSensitive)
Construct a GearTooth sensor given a channel and module.

Parameters:
slot - The slot in the chassis that the digital module is plugged in to.
channel - The GPIO channel on the digital module that the sensor is connected to.
directionSensitive - Enable the pulse length decoding in hardware to specify count direction.

GearTooth

public GearTooth(int slot,
                 int channel)
Construct a GearTooth sensor given a channel and module. No direction sensing is assumed.

Parameters:
slot - The slot in the chassis that the digital module is plugged in to.
channel - The GPIO channel on the digital module that the sensor is connected to.

GearTooth

public GearTooth(DigitalSource source,
                 boolean directionSensitive)
Construct a GearTooth sensor given a digital input. This should be used when sharing digial inputs.

Parameters:
source - An object that fully descibes the input that the sensor is connected to.
directionSensitive - Enable the pulse length decoding in hardware to specify count direction.

GearTooth

public GearTooth(DigitalSource source)
Construct a GearTooth sensor given a digital input. This should be used when sharing digial inputs. No direction sensing is assumed.

Parameters:
source - An object that fully descibes the input that the sensor is connected to.
Method Detail

enableDirectionSensing

public void enableDirectionSensing(boolean directionSensitive)
Common code called by the constructors.


getSmartDashboardType

public String getSmartDashboardType()
Description copied from class: Counter
Live Window code, only does anything if live window is activated.

Specified by:
getSmartDashboardType in interface Sendable
Overrides:
getSmartDashboardType in class Counter
Returns:
the string representation of the named data type that will be used by the smart dashboard for this sendable

"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"