1: /* 2: * Read the ADC on a 16C71. 3: */ 4: 5: 6: #include 7: #include "adc.h" 8: 9: 10: void 11: adc_read(unsigned char channel) 12: { 13: 14: ADCON0 = (channel << 3) + 0xC1; // enable ADC, RC osc. 15: ADGO = 1; 16: while(ADGO) 17: continue; // wait for conversion complete 18: }