From 72a56e6a8a8ab12fd671c9b767ed6f7c95cc2349 Mon Sep 17 00:00:00 2001 From: Joe Ross Date: Sat, 17 Jan 2015 22:28:02 -0800 Subject: [PATCH] Make index encoder constructors work. Change-Id: I50e1262128197e7d65ed773c998d820efde152fe --- .../src/main/java/edu/wpi/first/wpilibj/Encoder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wpilibj/wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/Encoder.java b/wpilibj/wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/Encoder.java index edbc3c0c29..4891e28b78 100644 --- a/wpilibj/wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/Encoder.java +++ b/wpilibj/wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/Encoder.java @@ -216,6 +216,7 @@ public class Encoder extends SensorBase implements CounterBase, PIDSource, LiveW m_bSource = new DigitalInput(bChannel); m_indexSource = new DigitalInput(indexChannel); initEncoder(reverseDirection); + setIndexSource(indexChannel); } /** @@ -328,7 +329,7 @@ public class Encoder extends SensorBase implements CounterBase, PIDSource, LiveW } /** - * Encoder constructor. Construct a Encoder given a and b channels as + * Encoder constructor. Construct a Encoder given a, b and index channels as * digital inputs. This is used in the case where the digital inputs are * shared. The Encoder class will not allocate the digital inputs and assume * that they already are counted. @@ -360,10 +361,11 @@ public class Encoder extends SensorBase implements CounterBase, PIDSource, LiveW m_bSource = bSource; m_indexSource = indexSource; initEncoder(reverseDirection); + setIndexSource(indexSource); } /** - * Encoder constructor. Construct a Encoder given a and b channels as + * Encoder constructor. Construct a Encoder given a, b and index channels as * digital inputs. This is used in the case where the digital inputs are * shared. The Encoder class will not allocate the digital inputs and assume * that they already are counted.