Now you can download a copy of these docs so you can use them offline! Download now
GearTooth.cpp
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2008. 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 $(WIND_BASE)/WPILib. */
5 /*----------------------------------------------------------------------------*/
6 
7 #include "GearTooth.h"
8 #include "LiveWindow/LiveWindow.h"
9 
10 constexpr double GearTooth::kGearToothThreshold;
11 
15 void GearTooth::EnableDirectionSensing(bool directionSensitive)
16 {
17  if (directionSensitive)
18  {
20  }
21 }
22 
31 GearTooth::GearTooth(uint32_t channel, bool directionSensitive)
32  : Counter(channel)
33 {
34  EnableDirectionSensing(directionSensitive);
35 }
36 
44 GearTooth::GearTooth(uint8_t moduleNumber, uint32_t channel, bool directionSensitive)
45  : Counter(moduleNumber, channel)
46 {
47  EnableDirectionSensing(directionSensitive);
48  LiveWindow::GetInstance()->AddSensor("GearTooth", moduleNumber, channel, this);
49 }
50 
58 GearTooth::GearTooth(DigitalSource *source, bool directionSensitive)
59  : Counter(source)
60 {
61  EnableDirectionSensing(directionSensitive);
62 }
63 
64 GearTooth::GearTooth(DigitalSource &source, bool directionSensitive): Counter(source)
65 {
66  EnableDirectionSensing(directionSensitive);
67 }
68 
73 {
74 }
75 
76 
78  return "GearTooth";
79 }
80 
void EnableDirectionSensing(bool directionSensitive)
Definition: GearTooth.cpp:15
void AddSensor(const char *subsystem, const char *name, LiveWindowSendable *component)
Definition: LiveWindow.cpp:82
GearTooth(uint32_t channel, bool directionSensitive=false)
Definition: GearTooth.cpp:31
virtual ~GearTooth()
Definition: GearTooth.cpp:72
static LiveWindow * GetInstance()
Definition: LiveWindow.cpp:13
virtual std::string GetSmartDashboardType()
Definition: GearTooth.cpp:77
void SetPulseLengthMode(float threshold)
Definition: Counter.cpp:498
static constexpr double kGearToothThreshold
55 uSec for threshold
Definition: GearTooth.h:22

Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by doxygen 1.8.6