diff options
Diffstat (limited to 'main.c')
-rwxr-xr-x | main.c | 14 |
1 files changed, 1 insertions, 13 deletions
@@ -5,6 +5,7 @@ #include "lcd.h" //Declaratons for LCD
#include "i2c.h"
#include "ds3231.h" //Declarations for RTC
+#include "adc.h" //Declarations for ADC
#include "beep.h" //Declarations for BEEP
#ifdef DEBUG
@@ -12,19 +13,6 @@ #include "term.h" //Declarations for Escape codes
#endif
-unsigned int Adc_Read(unsigned int channel) {
- ADFM = 1; // results right justified
- ADCS0 = 1; //conversion speed = 64*Tosc
- ADCS1 = 1;
- ADCS2 = 1; //For 16F877
- ADCON0bits.CHS = channel;
- ADON = 1; // Turn on ADC
- __delay_ms(1);
- GO_DONE = 1;
- while (ADCON0bits.GO_DONE == 1);
- return ((ADRESH << 8) + ADRESL); // ex 1024
-}
-
int main() {
TRISA0 = 0x01; // RA is input (ADC)
TRISC = 0x00; // Set PORTC as outputs
|