blob: 72b757c1434ef9bf66d4478925ea85357ff92ee7 [file] [log] [blame]
jerrymf1579332013-02-07 01:56:28 +00001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2008. All Rights Reserved. */
3/* Open Source Software - may be modified and shared by FRC teams. The code */
4/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
5/*----------------------------------------------------------------------------*/
6
7#ifndef GEAR_TOOTH_H_
8#define GEAR_TOOTH_H_
9
10#include "Counter.h"
11
12/**
13 * Alias for counter class.
14 * Implement the gear tooth sensor supplied by FIRST. Currently there is no reverse sensing on
15 * the gear tooth sensor, but in future versions we might implement the necessary timing in the
16 * FPGA to sense direction.
17 */
18class GearTooth : public Counter
19{
20public:
21 /// 55 uSec for threshold
22 static const double kGearToothThreshold = 55e-6;
23 GearTooth(UINT32 channel, bool directionSensitive = false);
24 GearTooth(UINT8 moduleNumber, UINT32 channel, bool directionSensitive = false);
25 GearTooth(DigitalSource *source, bool directionSensitive = false);
26 GearTooth(DigitalSource &source, bool directionSensitive = false);
27 virtual ~GearTooth();
28 void EnableDirectionSensing(bool directionSensitive);
29
30 virtual std::string GetSmartDashboardType();
31};
32
33
34#endif