#include <p24FJ128GB106.h>
#include "definitions.h"
#include "analog.h"
Go to the source code of this file.
#define ADC_MAX_VALUE 1023 |
Since the ADC is 10bits, the max value is 1023.
Definition at line 28 of file analog.c.
Min value must be zero.
Definition at line 30 of file analog.c.
Function: initADC
Preconditions: None.
Overview: Initializes the internal ADC module.
Arguments: None.
Returns: None.
Definition at line 43 of file analog.c.
int normalize_ADCReading |
( |
unsigned char |
inferiorLimit, |
|
|
unsigned char |
superiorLimit |
|
) |
| |
Function: normalize_ADCReading
Preconditions: ADC initialized.
Overview: Normalizes the ADC reading to a specified range.
Arguments: inferiorLimit, superiorLimit.
Returns: Normalized result.
Definition at line 83 of file analog.c.
Function: readADC
Preconditions: ADC initialized.
Overview: Reads the digital value of the input.
Arguments: None.
Returns: Current ADC value (integer).
Definition at line 64 of file analog.c.