WPILibC++  2020.2.2-33-g65eab93
GearTooth.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2008-2019 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 
26 class GearTooth : public Counter {
27  public:
28  // 55 uSec for threshold
29  static constexpr double kGearToothThreshold = 55e-6;
30 
40  "The only sensor this works with is no longer available and no teams use "
41  "it according to FMS usage reporting.")
42  explicit GearTooth(int channel, bool directionSensitive = false);
43 
55  "The only sensor this works with is no longer available and no teams use "
56  "it according to FMS usage reporting.")
57  explicit GearTooth(DigitalSource* source, bool directionSensitive = false);
58 
70  "The only sensor this works with is no longer available and no teams use "
71  "it according to FMS usage reporting.")
72  explicit GearTooth(std::shared_ptr<DigitalSource> source,
73  bool directionSensitive = false);
74 
75  GearTooth(GearTooth&&) = default;
76  GearTooth& operator=(GearTooth&&) = default;
77 
81  void EnableDirectionSensing(bool directionSensitive);
82 
83  void InitSendable(SendableBuilder& builder) override;
84 };
85 
86 } // namespace frc
frc::GearTooth::EnableDirectionSensing
void EnableDirectionSensing(bool directionSensitive)
Common code called by the constructors.
frc::GearTooth
Alias for counter class.
Definition: GearTooth.h:26
frc
WPILib FRC namespace.
Definition: AnalogOutSim.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.