WPILib 2012
WPILibRoboticsLibraryforFRC
|
#include <GearTooth.h>
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 |
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.
GearTooth::GearTooth | ( | UINT32 | channel, |
bool | directionSensitive = false |
||
) |
Construct a GearTooth sensor given a channel.
The default module is assumed.
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::GearTooth | ( | UINT8 | moduleNumber, |
UINT32 | channel, | ||
bool | directionSensitive = false |
||
) |
Construct a GearTooth sensor given a channel and module.
moduleNumber | The digital module (1 or 2). |
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::GearTooth | ( | DigitalSource * | source, |
bool | directionSensitive = false |
||
) |
Construct a GearTooth sensor given a digital input. This should be used when sharing digial inputs.
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::~GearTooth | ( | ) | [virtual] |
Free the resources associated with a gear tooth sensor.
void GearTooth::EnableDirectionSensing | ( | bool | directionSensitive | ) |
Common code called by the constructors.