forked from rbmj/wpilib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AnalogPotentiometer.h
38 lines (35 loc) · 1.21 KB
/
AnalogPotentiometer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef _ANALOG_POTENTIOMETER_H
#define _ANALOG_POTENTIOMETER_H
#include "Interfaces/Potentiometer.h"
#include "LiveWindow/LiveWindowSendable.h"
#include "AnalogChannel.h"
/**
* 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
*/
class AnalogPotentiometer : public Potentiometer, public LiveWindowSendable {
private:
int m_module, m_channel;
double m_scale, m_offset;
AnalogChannel *m_analog_channel;
void InitPot(int slot, int channel, double scale, double offset);
ITable *m_table;
public:
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();
};
#endif