#include <AnalogPotentiometer.h>
Public Member Functions | |
AnalogPotentiometer (int slot, int channel, double scale, double offset) | |
AnalogPotentiometer (int channel, double scale, double offset) | |
AnalogPotentiometer (int channel, double scale) | |
AnalogPotentiometer (int channel) | |
double | Get () |
double | PIDGet () |
std::string | GetSmartDashboardType () |
void | InitTable (ITable *subtable) |
void | UpdateTable () |
ITable * | GetTable () |
void | StartLiveWindowMode () |
void | StopLiveWindowMode () |
Additional Inherited Members | |
Public Types inherited from PIDSource | |
enum | PIDSourceParameter { kDistance, kRate, kAngle } |
Class for reading analog potentiometers. Analog potentiometers read in an analog voltage that corresponds to a position. Usually the position is either degrees or meters. However, if no conversion is given it remains volts.
Definition at line 16 of file AnalogPotentiometer.h.
AnalogPotentiometer::AnalogPotentiometer | ( | int | slot, |
int | channel, | ||
double | scale, | ||
double | offset | ||
) |
AnalogPotentiometer constructor.
Use the scaling 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 scale value is 270.0(degrees)/5.0(volts) and the offset is -135.0 since the halfway point after scaling is 135 degrees.
slot | The analog module this potentiometer is plugged into. |
channel | The analog channel this potentiometer is plugged into. |
scale | The scaling to multiply the voltage by to get a meaningful unit. |
offset | The offset to add to the scaled value for controlling the zero value |
Definition at line 33 of file AnalogPotentiometer.cpp.
AnalogPotentiometer::AnalogPotentiometer | ( | int | channel, |
double | scale, | ||
double | offset | ||
) |
AnalogPotentiometer constructor.
Use the scaling 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 scale value is 270.0(degrees)/5.0(volts) and the offset is -135.0 since the halfway point after scaling is 135 degrees.
channel | The analog channel this potentiometer is plugged into. |
scale | The scaling to multiply the voltage by to get a meaningful unit. |
offset | The offset to add to the scaled value for controlling the zero value |
Definition at line 51 of file AnalogPotentiometer.cpp.
AnalogPotentiometer::AnalogPotentiometer | ( | int | channel, |
double | scale | ||
) |
AnalogPotentiometer constructor.
Use the scaling 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 scale value is 270.0(degrees)/5.0(volts) and the offset is -135.0 since the halfway point after scaling is 135 degrees.
channel | The analog channel this potentiometer is plugged into. |
scale | The scaling to multiply the voltage by to get a meaningful unit. |
Definition at line 68 of file AnalogPotentiometer.cpp.
AnalogPotentiometer::AnalogPotentiometer | ( | int | channel | ) |
AnalogPotentiometer constructor.
channel | The analog channel this potentiometer is plugged into. |
Definition at line 77 of file AnalogPotentiometer.cpp.
|
virtual |
Get the current reading of the potentiomere.
Implements Potentiometer.
Definition at line 86 of file AnalogPotentiometer.cpp.
|
virtual |
Implements Sendable.
Definition at line 103 of file AnalogPotentiometer.cpp.
|
virtual |
Implements Sendable.
Definition at line 129 of file AnalogPotentiometer.cpp.
|
virtual |
Initializes a table for this sendable object.
subtable | The table to put the values in. |
Implements Sendable.
Definition at line 112 of file AnalogPotentiometer.cpp.
|
virtual |
Implement the PIDSource interface.
Implements PIDSource.
Definition at line 96 of file AnalogPotentiometer.cpp.
|
virtual |
Analog Channels don't have to do anything special when entering the LiveWindow. Start having this sendable object automatically respond to value changes reflect the value on the table.
Implements LiveWindowSendable.
Definition at line 137 of file AnalogPotentiometer.cpp.
|
virtual |
Analog Channels don't have to do anything special when exiting the LiveWindow. Stop having this sendable object automatically respond to value changes.
Implements LiveWindowSendable.
Definition at line 143 of file AnalogPotentiometer.cpp.
|
virtual |
Update the table for this sendable object with the latest values.
Implements LiveWindowSendable.
Definition at line 120 of file AnalogPotentiometer.cpp.