[wpilib] Improve new counter classes documentation (NFC) (#3801)

This commit is contained in:
sciencewhiz
2021-12-18 21:40:03 -08:00
committed by GitHub
parent dc531462e1
commit c46636f218
6 changed files with 42 additions and 9 deletions

View File

@@ -16,7 +16,12 @@ import edu.wpi.first.wpilibj.DigitalSource;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
/** Counter using external direction. */
/**
* Counter using external direction.
*
* <p>This counts on an edge from one digital input and the whether it counts up or down based on
* the state of a second digital input.
*/
public class ExternalDirectionCounter implements Sendable, AutoCloseable {
private final DigitalSource m_countSource;
private final DigitalSource m_directionSource;
@@ -67,7 +72,7 @@ public class ExternalDirectionCounter implements Sendable, AutoCloseable {
}
/**
* Sets to revert the counter direction.
* Sets to revese the counter direction.
*
* @param reverseDirection True to reverse counting direction.
*/

View File

@@ -16,7 +16,14 @@ import edu.wpi.first.wpilibj.DigitalSource;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
/** Tachometer. */
/**
* Tachometer.
*
* <p>The Tachometer class measures the time between digital pulses to determine the rotation speed
* of a mechanism. Examples of devices that could be used with the tachometer class are a hall
* effect sensor, break beam sensor, or optical sensor detecting tape on a shooter wheel. Unlike
* encoders, this class only needs a single digital input.
*/
public class Tachometer implements Sendable, AutoCloseable {
private final DigitalSource m_source;
private final int m_handle;
@@ -25,7 +32,7 @@ public class Tachometer implements Sendable, AutoCloseable {
/**
* Constructs a new tachometer.
*
* @param source The source.
* @param source The DigitalSource (e.g. DigitalInput) of the Tachometer.
*/
public Tachometer(DigitalSource source) {
m_source = requireNonNullParam(source, "source", "Tachometer");

View File

@@ -14,7 +14,12 @@ import edu.wpi.first.wpilibj.DigitalSource;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
/** Up Down Counter. */
/**
* Up Down Counter.
*
* <p>This class can count edges on a single digital input or count up based on an edge from one
* digital input and down on an edge from another digital input.
*/
public class UpDownCounter implements Sendable, AutoCloseable {
private DigitalSource m_upSource;
private DigitalSource m_downSource;
@@ -88,7 +93,7 @@ public class UpDownCounter implements Sendable, AutoCloseable {
}
/**
* Sets to revert the counter direction.
* Sets to reverse the counter direction.
*
* @param reverseDirection True to reverse counting direction.
*/