Add encoder indexing support in C++

Java will be done tonight or tomorrow

Change-Id: I3a3287a197b6f071c261172eb8ec930693e8b3c7
This commit is contained in:
Thomas Clark
2015-01-06 16:39:24 -05:00
parent 87e1df068c
commit a2dfffeddc
5 changed files with 165 additions and 18 deletions

View File

@@ -29,6 +29,7 @@ class DigitalSource;
class Encoder : public SensorBase, public CounterBase, public PIDSource, public LiveWindowSendable
{
public:
enum IndexingType { kResetWhileHigh, kResetWhileLow, kResetOnFallingEdge, kResetOnRisingEdge };
Encoder(uint32_t aChannel, uint32_t bChannel, bool reverseDirection = false,
EncodingType encodingType = k4X);
@@ -57,6 +58,10 @@ public:
void SetPIDSourceParameter(PIDSourceParameter pidSource);
double PIDGet();
void SetIndexSource(uint32_t channel, IndexingType type = kResetOnRisingEdge);
void SetIndexSource(DigitalSource *source, IndexingType type = kResetOnRisingEdge);
void SetIndexSource(DigitalSource &source, IndexingType type = kResetOnRisingEdge);
void UpdateTable();
void StartLiveWindowMode();
void StopLiveWindowMode();