bhan1992
Member level 1
- Joined
- Feb 25, 2012
- Messages
- 34
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,511
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.
Error [1105] symbol 'ADC_8ANA_0REF' has not been defined
Error [1203] too few arguments in function call
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