Add DutyCycleEncoder channel constructor (#2158)

Avoids extra boilerplate at user level.
This commit is contained in:
Thad House
2019-12-06 20:58:04 -08:00
committed by Peter Johnson
parent d8f11eb149
commit 67d2fed685
5 changed files with 27 additions and 10 deletions

View File

@@ -33,6 +33,16 @@ public class DutyCycleEncoder implements Sendable, AutoCloseable {
protected SimDouble m_simPosition;
protected SimBoolean m_simIsConnected;
/**
* Construct a new DutyCycleEncoder on a specific channel.
*
* @param channel the channel to attach to
*/
public DutyCycleEncoder(int channel) {
m_dutyCycle = new DutyCycle(new DigitalInput(channel));
init();
}
/**
* Construct a new DutyCycleEncoder attached to an existing DutyCycle object.
*