pic18f43k22 adc error

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

pic18f43k22 adc error

Postby bhan19920 » Wed Sep 04, 2013 11:18 am

i try to build the code below but it gives me the following errors. i checked that 'ADC_8ANA_0REF' is in the 'adc.h' header.
CODE: SELECT_ALL_CODE
#include <p18f43k22.h>
#include <adc.h>
#include <delays.h>
#include <stdlib.h>
#include <timers.h>
#include <salvo.h>
#undef OSC

void main (void)
{
   TRISB = 0;

   OSCreateTask(slow_beep, OSTCBP(1), 7);
   OSCreateTask(medium_beep, OSTCBP(2), 7);
   OSCreateTask(fast_beep, OSTCBP(3), 7);

   OpenTimer0 (TIMER_INT_ON & T0_16BIT & T0_SOURCE_INT & T0_PS_1_1);
   WriteTimer0(55536);
   INTCONbits.GIE = 1;

   OpenADC (ADC_FOSC_32 & ADC_RIGHT_JUST & ADC_2_TAD & ADC_8ANA_0REF, ADC_CH0 & ADC_INT_OFF);
   PORTB = 1;      //initialisation 0.7 second beep
   Delay10KTCYx(10);   
   PORTB = 0;

   while(1)
   {
   SetChanADC(ADC_CH0);
   ConvertADC();
   while(BusyADC());
   result = ReadADC();
   OSSched();
   OS_Delay(10,main)   //delay0.1 second
   }
   CloseADC();
}


Error [1105] symbol 'ADC_8ANA_0REF' has not been defined
Error [1203] too few arguments in function call
bhan19920
Newbie
 
Posts: 8
Joined: Fri Apr 06, 2012 11:18 pm

Re: pic18f43k22 adc error

Postby robosang » Wed Sep 04, 2013 9:16 pm

What is this compiler?
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 22 guests