mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
Moved C++ comments from source files to headers (#1111)
Also sorted functions in C++ sources to match order in related headers.
This commit is contained in:
committed by
Peter Johnson
parent
d9971a705a
commit
8c680a26f8
@@ -27,7 +27,7 @@ class AnalogPotentiometer : public ErrorBase,
|
||||
public Potentiometer {
|
||||
public:
|
||||
/**
|
||||
* AnalogPotentiometer constructor.
|
||||
* Construct an Analog Potentiometer object from a channel number.
|
||||
*
|
||||
* 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
|
||||
@@ -38,18 +38,57 @@ class AnalogPotentiometer : public ErrorBase,
|
||||
* 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 fullRange The scaling to multiply the voltage by to get a meaningful
|
||||
* unit.
|
||||
* @param offset The offset to add to the scaled value for controlling the
|
||||
* zero value.
|
||||
* @param channel The channel number on the roboRIO to represent. 0-3 are
|
||||
* on-board 4-7 are on the MXP port.
|
||||
* @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.
|
||||
*/
|
||||
explicit AnalogPotentiometer(int channel, double fullRange = 1.0,
|
||||
double offset = 0.0);
|
||||
|
||||
/**
|
||||
* Construct an Analog Potentiometer object from an existing Analog Input
|
||||
* pointer.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This will calculate the result from the fullRange times the fraction of the
|
||||
* supply voltage, plus the offset.
|
||||
*
|
||||
* @param channel The existing Analog Input pointer
|
||||
* @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.
|
||||
*/
|
||||
explicit AnalogPotentiometer(AnalogInput* input, double fullRange = 1.0,
|
||||
double offset = 0.0);
|
||||
|
||||
/**
|
||||
* Construct an Analog Potentiometer object from an existing Analog Input
|
||||
* pointer.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This will calculate the result from the fullRange times the fraction of the
|
||||
* supply voltage, plus the offset.
|
||||
*
|
||||
* @param channel The existing Analog Input pointer
|
||||
* @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.
|
||||
*/
|
||||
explicit AnalogPotentiometer(std::shared_ptr<AnalogInput> input,
|
||||
double fullRange = 1.0, double offset = 0.0);
|
||||
|
||||
@@ -58,7 +97,8 @@ class AnalogPotentiometer : public ErrorBase,
|
||||
/**
|
||||
* Get the current reading of the potentiomer.
|
||||
*
|
||||
* @return The current position of the potentiometer.
|
||||
* @return The current position of the potentiometer (in the units used for
|
||||
* fullRange and offset).
|
||||
*/
|
||||
double Get() const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user