[wpilib] Improve and sync AnalogPotentiometer docs (NFC) (#2580)

This commit is contained in:
sciencewhiz
2020-07-13 22:00:53 -07:00
committed by GitHub
parent 16ef372b53
commit b06ddcdd86
2 changed files with 32 additions and 24 deletions

View File

@@ -32,7 +32,8 @@ public class AnalogPotentiometer implements Potentiometer, Sendable, AutoCloseab
* point after scaling is 135 degrees. This will calculate the result from the fullRange times
* the fraction of the supply voltage, plus the offset.
*
* @param channel The analog channel this potentiometer is plugged into.
* @param channel The analog input channel this potentiometer is plugged into. 0-3 are
* on-board and 4-7 are on the MXP port.
* @param fullRange The scaling to multiply the fraction by to get a meaningful unit.
* @param offset The offset to add to the scaled value for controlling the zero value
*/
@@ -46,14 +47,16 @@ public class AnalogPotentiometer implements Potentiometer, Sendable, AutoCloseab
* AnalogPotentiometer constructor.
*
* <p>Use the fullRange and offset values so that the output produces meaningful values. I.E: you
* have a 270 degree potentiometer and you want the output to be degrees with the halfway point as
* 0 degrees. The fullRange value is 270.0(degrees) and the offset is -135.0 since the halfway
* have a 270 degree potentiometer and you want the output to be degrees with the halfway point
* as 0 degrees. The fullRange value is 270.0(degrees) and the offset is -135.0 since the halfway
* point after scaling is 135 degrees. This will calculate the result from the fullRange times
* the fraction of the supply voltage, plus the offset.
*
* @param input The {@link AnalogInput} this potentiometer is plugged into.
* @param fullRange The scaling to multiply the fraction by to get a meaningful unit.
* @param offset The offset to add to the scaled value for controlling the zero value
* @param fullRange The angular value (in desired units) representing the full
* 0-5V range of the input.
* @param offset The angular value (in desired units) representing the
* angular output at 0V.
*/
public AnalogPotentiometer(final AnalogInput input, double fullRange, double offset) {
SendableRegistry.addLW(this, "AnalogPotentiometer", input.getChannel());
@@ -67,12 +70,12 @@ public class AnalogPotentiometer implements Potentiometer, Sendable, AutoCloseab
/**
* AnalogPotentiometer constructor.
*
* <p>Use the fullRange and offset values so that the output produces meaningful values. I.E: you
* have a 270 degree potentiometer and you want the output to be degrees with the halfway point as
* 0 degrees. The fullRange value is 270.0(degrees) and the offset is -135.0 since the halfway
* point after scaling is 135 degrees.
* <p>Use the scale value so that the output produces meaningful values. I.E: you
* have a 270 degree potentiometer and you want the output to be degrees with the starting point
* as 0 degrees. The scale value is 270.0(degrees).
*
* @param channel The analog channel this potentiometer is plugged into.
* @param channel The analog input channel this potentiometer is plugged into. 0-3 are
* on-board and 4-7 are on the MXP port.
* @param scale The scaling to multiply the voltage by to get a meaningful unit.
*/
public AnalogPotentiometer(final int channel, double scale) {
@@ -83,9 +86,8 @@ public class AnalogPotentiometer implements Potentiometer, Sendable, AutoCloseab
* AnalogPotentiometer constructor.
*
* <p>Use the fullRange and offset values so that the output produces meaningful values. I.E: you
* have a 270 degree potentiometer and you want the output to be degrees with the halfway point as
* 0 degrees. The fullRange value is 270.0(degrees) and the offset is -135.0 since the halfway
* point after scaling is 135 degrees.
* have a 270 degree potentiometer and you want the output to be degrees with the starting point
* as 0 degrees. The scale value is 270.0(degrees).
*
* @param input The {@link AnalogInput} this potentiometer is plugged into.
* @param scale The scaling to multiply the voltage by to get a meaningful unit.
@@ -97,7 +99,10 @@ public class AnalogPotentiometer implements Potentiometer, Sendable, AutoCloseab
/**
* AnalogPotentiometer constructor.
*
* @param channel The analog channel this potentiometer is plugged into.
* <p>The potentiometer will return a value between 0 and 1.0.
*
* @param channel The analog input channel this potentiometer is plugged into. 0-3 are
* on-board and 4-7 are on the MXP port.
*/
public AnalogPotentiometer(final int channel) {
this(channel, 1, 0);
@@ -106,6 +111,8 @@ public class AnalogPotentiometer implements Potentiometer, Sendable, AutoCloseab
/**
* AnalogPotentiometer constructor.
*
* <p>The potentiometer will return a value between 0 and 1.0.
*
* @param input The {@link AnalogInput} this potentiometer is plugged into.
*/
public AnalogPotentiometer(final AnalogInput input) {