#include "OB6710.h"
#include "ADC.h"

unsigned int ResultData[4];
void main(void)
{
	unsigned char Length;
  //----------P2.7 is input Only--------
	P2M0 = P2M0 & 0x7F;
	P2M1 = P2M1 | 0x80;
	ADC_Init();
	ADC_SetInputSource(d_ADC_INPUT_1ST, d_ADC_BG_06V_IN, d_ADC_MODE_continue);
  //-----------------
	ADC_SetInputSource(d_ADC_INPUT_2ND, d_ADC_CH0_IN, d_ADC_MODE_continue);// ADC channel_0 = P2.7

	Length = 0x02;
	ADC_start(Length);
	ADC_GetSampleResult(ResultData, Length);
	while(1);
}