Home
Roadside
Carputer
geoHist
software
FRC
Blog
Now you can download a copy of these docs so you can use them offline!
Download now
Main Page
Related Pages
Classes
Files
File List
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
{
19
SetPulseLengthMode
(
kGearToothThreshold
);
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
72
GearTooth::~GearTooth
()
73
{
74
}
75
76
77
std::string
GearTooth::GetSmartDashboardType
() {
78
return
"GearTooth"
;
79
}
80
GearTooth::EnableDirectionSensing
void EnableDirectionSensing(bool directionSensitive)
Definition:
GearTooth.cpp:15
LiveWindow::AddSensor
void AddSensor(const char *subsystem, const char *name, LiveWindowSendable *component)
Definition:
LiveWindow.cpp:82
GearTooth::GearTooth
GearTooth(uint32_t channel, bool directionSensitive=false)
Definition:
GearTooth.cpp:31
GearTooth::~GearTooth
virtual ~GearTooth()
Definition:
GearTooth.cpp:72
LiveWindow::GetInstance
static LiveWindow * GetInstance()
Definition:
LiveWindow.cpp:13
Counter
Definition:
Counter.h:21
DigitalSource
Definition:
DigitalSource.h:19
GearTooth::GetSmartDashboardType
virtual std::string GetSmartDashboardType()
Definition:
GearTooth.cpp:77
Counter::SetPulseLengthMode
void SetPulseLengthMode(float threshold)
Definition:
Counter.cpp:498
GearTooth::kGearToothThreshold
static constexpr double kGearToothThreshold
55 uSec for threshold
Definition:
GearTooth.h:22
Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by
1.8.6
© 2006-2009 Dustin Spicuzza. All rights reserved.
Powered by Onnac
I do not condone or encourage graffiti. Please paint responsibly.