Class for supporting continuous analog encoders, such as the US Digital MA3.
More...
#include <wpi/hardware/rotation/AnalogEncoder.hpp>
Class for supporting continuous analog encoders, such as the US Digital MA3.
◆ AnalogEncoder() [1/9]
| wpi::AnalogEncoder::AnalogEncoder |
( |
int | channel | ) |
|
|
explicit |
Construct a new AnalogEncoder attached to a specific AnalogIn channel.
This has a fullRange of 1 and an expectedZero of 0.
- Parameters
-
| channel | the analog input channel to attach to |
◆ AnalogEncoder() [2/9]
| wpi::AnalogEncoder::AnalogEncoder |
( |
AnalogInput & | analogInput | ) |
|
|
explicit |
Construct a new AnalogEncoder attached to a specific AnalogInput.
This has a fullRange of 1 and an expectedZero of 0.
- Parameters
-
| analogInput | the analog input to attach to |
◆ AnalogEncoder() [3/9]
| wpi::AnalogEncoder::AnalogEncoder |
( |
AnalogInput * | analogInput | ) |
|
|
explicit |
Construct a new AnalogEncoder attached to a specific AnalogInput.
This has a fullRange of 1 and an expectedZero of 0.
- Parameters
-
| analogInput | the analog input to attach to |
◆ AnalogEncoder() [4/9]
| wpi::AnalogEncoder::AnalogEncoder |
( |
std::shared_ptr< AnalogInput > | analogInput | ) |
|
|
explicit |
Construct a new AnalogEncoder attached to a specific AnalogInput.
This has a fullRange of 1 and an expectedZero of 0.
- Parameters
-
| analogInput | the analog input to attach to |
◆ AnalogEncoder() [5/9]
| wpi::AnalogEncoder::AnalogEncoder |
( |
int | channel, |
|
|
double | fullRange, |
|
|
double | expectedZero ) |
Construct a new AnalogEncoder attached to a specific AnalogIn channel.
- Parameters
-
| channel | the analog input channel to attach to |
| fullRange | the value to report at maximum travel |
| expectedZero | the reading where you would expect a 0 from get() |
◆ AnalogEncoder() [6/9]
| wpi::AnalogEncoder::AnalogEncoder |
( |
AnalogInput & | analogInput, |
|
|
double | fullRange, |
|
|
double | expectedZero ) |
Construct a new AnalogEncoder attached to a specific AnalogInput.
- Parameters
-
| analogInput | the analog input to attach to |
| fullRange | the value to report at maximum travel |
| expectedZero | the reading where you would expect a 0 from get() |
◆ AnalogEncoder() [7/9]
| wpi::AnalogEncoder::AnalogEncoder |
( |
AnalogInput * | analogInput, |
|
|
double | fullRange, |
|
|
double | expectedZero ) |
Construct a new AnalogEncoder attached to a specific AnalogInput.
- Parameters
-
| analogInput | the analog input to attach to |
| fullRange | the value to report at maximum travel |
| expectedZero | the reading where you would expect a 0 from get() |
◆ AnalogEncoder() [8/9]
| wpi::AnalogEncoder::AnalogEncoder |
( |
std::shared_ptr< AnalogInput > | analogInput, |
|
|
double | fullRange, |
|
|
double | expectedZero ) |
Construct a new AnalogEncoder attached to a specific AnalogInput.
- Parameters
-
| analogInput | the analog input to attach to |
| fullRange | the value to report at maximum travel |
| expectedZero | the reading where you would expect a 0 from get() |
◆ ~AnalogEncoder()
| wpi::AnalogEncoder::~AnalogEncoder |
( |
| ) |
|
|
override |
◆ AnalogEncoder() [9/9]
| wpi::AnalogEncoder::AnalogEncoder |
( |
AnalogEncoder && | | ) |
|
|
default |
◆ Get()
| double wpi::AnalogEncoder::Get |
( |
| ) |
const |
Get the encoder value.
- Returns
- the encoder value scaled by the full range input
◆ GetChannel()
| int wpi::AnalogEncoder::GetChannel |
( |
| ) |
const |
Get the channel number.
- Returns
- The channel number.
◆ InitSendable()
◆ operator=()
◆ SetInverted()
| void wpi::AnalogEncoder::SetInverted |
( |
bool | inverted | ) |
|
Set if this encoder is inverted.
- Parameters
-
| inverted | true to invert the encoder, false otherwise |
◆ SetVoltagePercentageRange()
| void wpi::AnalogEncoder::SetVoltagePercentageRange |
( |
double | min, |
|
|
double | max ) |
Set the encoder voltage percentage range.
Analog sensors are not always fully stable at the end of their travel ranges. Shrinking this range down can help mitigate issues with that.
- Parameters
-
| min | minimum voltage percentage (0-1 range) |
| max | maximum voltage percentage (0-1 range) |
The documentation for this class was generated from the following file: