Class for a generic potentiometer which is used to determine its position.
Definition: potentiometer.h:20
uint8_t ADC_PIN
Pin to read voltage from (0 - 3.3V)
Definition: potentiometer.h:23
float voltage
Input voltage from ADC reading.
Definition: potentiometer.h:43
float get_angle(void)
The method to return the position of the potentiometer.
Definition: potentiometer.cpp:41
uint16_t adc_value
ADC value from the GPIO input pin.
Definition: potentiometer.h:40
float VOLTAGE_TO_DEGREES
Conversion from voltage to degrees determined experimentally.
Definition: potentiometer.h:33
const uint16_t ADC_RANGE
ADC range determined by a default 12 bit resolution.
Definition: potentiometer.h:25
float get_voltage(void)
The method to retrieve the voltage at the input pin.
Definition: potentiometer.cpp:27
void zero(void)
The method to zero the potentiometer to its current position.
Definition: potentiometer.cpp:58
float voltage_offset
The offset used to zero the potentiometer.
Definition: potentiometer.h:30
const float VOLTAGE_SOURCE
Voltage source reference to scale ADC reading.
Definition: potentiometer.h:27