'**************************************************************** '* Name : UNTITLED.BAS * '* Author : [select VIEW...EDITOR OPTIONS] * '* Notice : Copyright (c) 2006 [select VIEW...EDITOR OPTIONS] * '* : All Rights Reserved * '* Date : 1/30/2006 * '* Version : 1.0 * '* Notes : * '* : * '**************************************************************** DEFINE ADC_BITS 10 ' Set number of bits in result DEFINE ADC_CLOCK 3 ' Set clock source (3=rc) DEFINE ADC_SAMPLEUS 20 ADCvar VAR WORD ' Create variable to store result TRISA = %11111111 ' Set PORTA to all input ADCON1 = %10000010 ' Set PORTA analog and right justify result Pause 500 ' Wait .5 second main: ADCIN 0, ADCvar ' Read channel 0 to adval serout2 PORTC.6, 16468, [DEC ADCvar, 13, 10] ' print it to serial out, ' with linefeed and carriage return (10, 13) GoTo main ' Do it forever