Now you can download a copy of these docs so you can use them offline! Download now
AnalogPotentiometer Class Reference

#include <AnalogPotentiometer.h>

Inheritance diagram for AnalogPotentiometer:
Collaboration 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 ()
 
ITableGetTable ()
 
void StartLiveWindowMode ()
 
void StopLiveWindowMode ()
 

Additional Inherited Members

- Public Types inherited from PIDSource
enum  PIDSourceParameter { kDistance, kRate, kAngle }
 

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

Definition at line 16 of file AnalogPotentiometer.h.

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

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.

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

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.

Parameters
channelThe analog channel this potentiometer is plugged into.
scaleThe 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.

Parameters
channelThe analog channel this potentiometer is plugged into.

Definition at line 77 of file AnalogPotentiometer.cpp.

Member Function Documentation

double AnalogPotentiometer::Get ( )
virtual

Get the current reading of the potentiomere.

Returns
The current position of the potentiometer.

Implements Potentiometer.

Definition at line 86 of file AnalogPotentiometer.cpp.

std::string AnalogPotentiometer::GetSmartDashboardType ( )
virtual
Returns
the string representation of the named data type that will be used by the smart dashboard for this sendable

Implements Sendable.

Definition at line 103 of file AnalogPotentiometer.cpp.

ITable * AnalogPotentiometer::GetTable ( )
virtual

Returns
the table that is currently associated with the sendable

Implements Sendable.

Definition at line 129 of file AnalogPotentiometer.cpp.

void AnalogPotentiometer::InitTable ( ITable subtable)
virtual

Initializes a table for this sendable object.

Parameters
subtableThe table to put the values in.

Implements Sendable.

Definition at line 112 of file AnalogPotentiometer.cpp.

double AnalogPotentiometer::PIDGet ( )
virtual

Implement the PIDSource interface.

Returns
The current reading.

Implements PIDSource.

Definition at line 96 of file AnalogPotentiometer.cpp.

void AnalogPotentiometer::StartLiveWindowMode ( )
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.

void AnalogPotentiometer::StopLiveWindowMode ( )
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.

void AnalogPotentiometer::UpdateTable ( )
virtual

Update the table for this sendable object with the latest values.

Implements LiveWindowSendable.

Definition at line 120 of file AnalogPotentiometer.cpp.


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

Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by doxygen 1.8.6