Now you can download a copy of these docs so you can use them offline! Download now
AnalogPotentiometer.cpp
1 #include "AnalogPotentiometer.h"
2 
10  void AnalogPotentiometer::InitPot(int slot, int channel, double scale, double offset) {
11  m_module = slot;
12  m_channel = channel;
13  m_scale = scale;
14  m_offset = offset;
15  m_analog_channel = new AnalogChannel(slot, channel);
16  }
17 
33  AnalogPotentiometer::AnalogPotentiometer(int slot, int channel, double scale, double offset) {
34  InitPot(slot, channel, scale, offset);
35  }
36 
51  AnalogPotentiometer::AnalogPotentiometer(int channel, double scale, double offset) {
52  InitPot(1, channel, scale, offset);
53  }
54 
68  AnalogPotentiometer::AnalogPotentiometer(int channel, double scale) {
69  InitPot(1, channel, scale, 0);
70  }
71 
78  InitPot(1, channel, 1, 0);
79  }
80 
87  return m_analog_channel->GetVoltage() * m_scale + m_offset;
88  }
89 
90 
97  return Get();
98  }
99 
100  /*
101  * Live Window code, only does anything if live window is activated.
102  */
104  return "Analog Input";
105  }
106 
107  ITable *m_table;
108 
113  m_table = subtable;
114  UpdateTable();
115  }
116 
121  if (m_table != NULL) {
122  m_table->PutNumber("Value", Get());
123  }
124  }
125 
130  return m_table;
131  }
132 
138 
144 
virtual void PutNumber(std::string key, double value)=0
Definition: ITable.h:26
std::string GetSmartDashboardType()
void InitTable(ITable *subtable)
AnalogPotentiometer(int slot, int channel, double scale, double offset)

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