WPILib  2014.0
WPIRoboticsLibraryforFRC
 All Classes Functions Variables Pages
Public Member Functions | List of all members
AnalogPotentiometer Class Reference

#include <AnalogPotentiometer.h>

Inheritance diagram for AnalogPotentiometer:

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 ()
 

Detailed Description

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.

Author
Alex Henning

Constructor & Destructor Documentation

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.

Parameters
slotThe analog module this potentiometer is plugged into.
channelThe analog channel this potentiometer is plugged into.
scaleThe scaling to multiply the voltage by to get a meaningful unit.
offsetThe offset to add to the scaled value for controlling the zero value
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.

Parameters
channelThe analog channel this potentiometer is plugged into.
scaleThe scaling to multiply the voltage by to get a meaningful unit.
offsetThe offset to add to the scaled value for controlling the zero value
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.

Parameters
channelThe analog channel this potentiometer is plugged into.
scaleThe scaling to multiply the voltage by to get a meaningful unit.
AnalogPotentiometer::AnalogPotentiometer ( int  channel)

AnalogPotentiometer constructor.

Parameters
channelThe analog channel this potentiometer is plugged into.

Member Function Documentation

double AnalogPotentiometer::Get ( )

Get the current reading of the potentiomere.

Returns
The current position of the potentiometer.
ITable * AnalogPotentiometer::GetTable ( )
void AnalogPotentiometer::InitTable ( ITable *  subtable)
double AnalogPotentiometer::PIDGet ( )

Implement the PIDSource interface.

Returns
The current reading.
void AnalogPotentiometer::StartLiveWindowMode ( )

Analog Channels don't have to do anything special when entering the LiveWindow.

void AnalogPotentiometer::StopLiveWindowMode ( )

Analog Channels don't have to do anything special when exiting the LiveWindow.

void AnalogPotentiometer::UpdateTable ( )

The documentation for this class was generated from the following files: