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 "Counter.h"
11 #include <memory>
12 
21 class GearTooth : public Counter {
22  public:
24  static constexpr double kGearToothThreshold = 55e-6;
25  GearTooth(uint32_t channel, bool directionSensitive = false);
26  GearTooth(DigitalSource *source, bool directionSensitive = false);
27  GearTooth(std::shared_ptr<DigitalSource> source,
28  bool directionSensitive = false);
29  virtual ~GearTooth() = default;
30  void EnableDirectionSensing(bool directionSensitive);
31 
32  virtual std::string GetSmartDashboardType() const override;
33 };
static constexpr double kGearToothThreshold
55 uSec for threshold
Definition: GearTooth.h:24
GearTooth(uint32_t channel, bool directionSensitive=false)
Construct a GearTooth sensor given a channel.
Definition: GearTooth.cpp:30
DigitalSource Interface.
Definition: DigitalSource.h:22
Class for counting the number of ticks on a digital input channel.
Definition: Counter.h:31
virtual std::string GetSmartDashboardType() const override
Definition: GearTooth.cpp:64
Alias for counter class.
Definition: GearTooth.h:21
void EnableDirectionSensing(bool directionSensitive)
Common code called by the constructors.
Definition: GearTooth.cpp:16