WPILibC++  unspecified
GearTooth.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2008-2018 FIRST. 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 
24 class GearTooth : public Counter {
25  public:
26  // 55 uSec for threshold
27  static constexpr double kGearToothThreshold = 55e-6;
28 
29  explicit GearTooth(int channel, bool directionSensitive = false);
30  explicit GearTooth(DigitalSource* source, bool directionSensitive = false);
31  explicit GearTooth(std::shared_ptr<DigitalSource> source,
32  bool directionSensitive = false);
33 
34  void EnableDirectionSensing(bool directionSensitive);
35 
36  void InitSendable(SendableBuilder& builder) override;
37 };
38 
39 } // namespace frc
GearTooth(int channel, bool directionSensitive=false)
Construct a GearTooth sensor given a channel.
Definition: GearTooth.cpp:33
Definition: RobotController.cpp:14
void InitSendable(SendableBuilder &builder) override
Initializes this Sendable object.
Definition: GearTooth.cpp:71
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:24
Definition: SendableBuilder.h:23
void EnableDirectionSensing(bool directionSensitive)
Common code called by the constructors.
Definition: GearTooth.cpp:19