WPILib 2012
WPILibRoboticsLibraryforFRC
Public Member Functions | Static Public Attributes
GearTooth Class Reference

#include <GearTooth.h>

Inheritance diagram for GearTooth:
Counter SensorBase CounterBase ErrorBase

List of all members.

Public Member Functions

 GearTooth (UINT32 channel, bool directionSensitive=false)
 GearTooth (UINT8 moduleNumber, UINT32 channel, bool directionSensitive=false)
 GearTooth (DigitalSource *source, bool directionSensitive=false)
 GearTooth (DigitalSource &source, bool directionSensitive=false)
virtual ~GearTooth ()
void EnableDirectionSensing (bool directionSensitive)

Static Public Attributes

static const double kGearToothThreshold = 55e-6
 55 uSec for threshold

Detailed Description

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.


Constructor & Destructor Documentation

GearTooth::GearTooth ( UINT32  channel,
bool  directionSensitive = false 
)

Construct a GearTooth sensor given a channel.

The default module is assumed.

Parameters:
channelThe GPIO channel on the digital module that the sensor is connected to.
directionSensitiveEnable the pulse length decoding in hardware to specify count direction.
GearTooth::GearTooth ( UINT8  moduleNumber,
UINT32  channel,
bool  directionSensitive = false 
)

Construct a GearTooth sensor given a channel and module.

Parameters:
moduleNumberThe digital module (1 or 2).
channelThe GPIO channel on the digital module that the sensor is connected to.
directionSensitiveEnable the pulse length decoding in hardware to specify count direction.
GearTooth::GearTooth ( DigitalSource source,
bool  directionSensitive = false 
)

Construct a GearTooth sensor given a digital input. This should be used when sharing digial inputs.

Parameters:
sourceAn object that fully descibes the input that the sensor is connected to.
directionSensitiveEnable the pulse length decoding in hardware to specify count direction.
GearTooth::~GearTooth ( ) [virtual]

Free the resources associated with a gear tooth sensor.


Member Function Documentation

void GearTooth::EnableDirectionSensing ( bool  directionSensitive)

Common code called by the constructors.


The documentation for this class was generated from the following files:
 All Classes Functions Variables