WPILibC++  2020.3.2-60-g3011ebe
GearTooth.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2008-2020 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 <wpi/deprecated.h>
14 
15 #include "frc/Counter.h"
16 
17 namespace frc {
18 
28 class GearTooth : public Counter {
29  public:
30  // 55 uSec for threshold
31  static constexpr double kGearToothThreshold = 55e-6;
32 
42  "The only sensor this works with is no longer available and no teams use "
43  "it according to FMS usage reporting.")
44  explicit GearTooth(int channel, bool directionSensitive = false);
45 
57  "The only sensor this works with is no longer available and no teams use "
58  "it according to FMS usage reporting.")
59  explicit GearTooth(DigitalSource* source, bool directionSensitive = false);
60 
72  "The only sensor this works with is no longer available and no teams use "
73  "it according to FMS usage reporting.")
74  explicit GearTooth(std::shared_ptr<DigitalSource> source,
75  bool directionSensitive = false);
76 
77  GearTooth(GearTooth&&) = default;
78  GearTooth& operator=(GearTooth&&) = default;
79 
83  void EnableDirectionSensing(bool directionSensitive);
84 
85  void InitSendable(SendableBuilder& builder) override;
86 };
87 
88 } // namespace frc
frc::GearTooth::EnableDirectionSensing
void EnableDirectionSensing(bool directionSensitive)
Common code called by the constructors.
frc::GearTooth
Alias for counter class.
Definition: GearTooth.h:28
frc
A class that enforces constraints on the differential drive kinematics.
Definition: PDPSim.h:16
frc::Counter
Class for counting the number of ticks on a digital input channel.
Definition: Counter.h:37
frc::DigitalSource
DigitalSource Interface.
Definition: DigitalSource.h:25
frc::GearTooth::WPI_DEPRECATED
WPI_DEPRECATED("The only sensor this works with is no longer available and no teams use " "it according to FMS usage reporting.") explicit GearTooth(int channel
Construct a GearTooth sensor given a channel.
frc::SendableBuilder
Definition: SendableBuilder.h:23
frc::GearTooth::InitSendable
void InitSendable(SendableBuilder &builder) override
Initializes this Sendable object.