WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
GearTooth.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2008-2016. 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 the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include <memory>
11 #include <string>
12 
13 #include "Counter.h"
14 
15 namespace frc {
16 
23 class GearTooth : public Counter {
24  public:
26  static constexpr double kGearToothThreshold = 55e-6;
27  explicit GearTooth(int channel, bool directionSensitive = false);
28  explicit GearTooth(DigitalSource* source, bool directionSensitive = false);
29  explicit GearTooth(std::shared_ptr<DigitalSource> source,
30  bool directionSensitive = false);
31  virtual ~GearTooth() = default;
32  void EnableDirectionSensing(bool directionSensitive);
33 
34  std::string GetSmartDashboardType() const override;
35 };
36 
37 } // namespace frc
GearTooth(int channel, bool directionSensitive=false)
Construct a GearTooth sensor given a channel.
Definition: GearTooth.cpp:33
Class for counting the number of ticks on a digital input channel.
Definition: Counter.h:33
DigitalSource Interface.
Definition: DigitalSource.h:25
Alias for counter class.
Definition: GearTooth.h:23
static constexpr double kGearToothThreshold
55 uSec for threshold
Definition: GearTooth.h:26
std::string GetSmartDashboardType() const override
Definition: GearTooth.cpp:69
void EnableDirectionSensing(bool directionSensitive)
Common code called by the constructors.
Definition: GearTooth.cpp:19