[wpilib] Counter: Fix default distance per pulse, add distance and rate to C++ (#5796)

- Default distance per pulse in java was 0; 1 is a more reasonable default
- C++ was missing this functionality
This commit is contained in:
Ryan Blue
2023-10-20 02:42:53 -04:00
committed by GitHub
parent b14a61e1c0
commit abb2857e03
3 changed files with 42 additions and 1 deletions

View File

@@ -51,7 +51,7 @@ public class Counter implements CounterBase, Sendable, AutoCloseable {
private boolean m_allocatedDownSource;
int m_counter; // /< The FPGA counter object.
private int m_index; // /< The index of this counter.
private double m_distancePerPulse; // distance of travel for each tick
private double m_distancePerPulse = 1; // distance of travel for each tick
/**
* Create an instance of a counter with the given mode.