unsigned adData;

unsigned i;

char adDataString[3];


void main(void){

ANSEL = 0b01100100; //0x64

TRISIO = 0b00000100; //0x04

CMCON0 = 0b00000111; //0x07

Soft_UART_Init(&GPIO, 1, 0, 19200, 0);

ADC_Init();

while(1){

adData = ADC_Get_Sample(2);

WordToHex(adData, adDataString);

for(i=0; i<strlen(adDataString); i++)

{

Soft_UART_Write(adDataString[i]);

Delay_ms(20);

}

Delay_ms(20);

Soft_UART_Write(0x0D);

Delay_ms(20);

Soft_UART_Write(0x0A);

Delay_ms(500);

}

}