Page 1 of 1

pic18f43k22 adc error

PostPosted: Wed Sep 04, 2013 11:18 am
by bhan19920
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

Re: pic18f43k22 adc error

PostPosted: Wed Sep 04, 2013 9:16 pm
by robosang
What is this compiler?