EDF - OnePIC MCU  v1.1.0
Potentiometer
Collaboration diagram for Potentiometer:

Defines

#define FILTER_MEDIAN_LENGTH   3
#define FILTER_MIDDLE_VALUE   (FILTER_MEDIAN_LENGTH-1)/2

Functions

void EDF_potInit (void)
 Initilizes the POT to take a reading.
uint16_t filterMedian (uint16_t d)
 experiencing some dropped readings, so the median filter takes three samples and passes the median of the three
uint16_t EDF_potRead (void)
 takes the reading

Function Documentation

void EDF_potInit ( void  )

Initilizes the POT to take a reading.

Note:
must call this every time before processing ADC due to mTouch configureing ADCON

Definition at line 42 of file OnePIC_16bit_pot.c.

uint16_t EDF_potRead ( void  )

takes the reading

Returns:
the 16bit digital representation of the analog voltage

Definition at line 73 of file OnePIC_16bit_pot.c.

Here is the call graph for this function:

uint16_t filterMedian ( uint16_t  d)

experiencing some dropped readings, so the median filter takes three samples and passes the median of the three

Parameters:
dadc value
Returns:
16bit average of the ADC

Definition at line 54 of file OnePIC_16bit_pot.c.