mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Add DutyCycleEncoder channel constructor (#2158)
Avoids extra boilerplate at user level.
This commit is contained in:
committed by
Peter Johnson
parent
d8f11eb149
commit
67d2fed685
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user