Professional Documents
Culture Documents
Slector Ads
Slector Ads
void main() {
osccon = 0x7f;
adcon1 = 0x0A;
trisb = 0;
trisd = 0xfc;
TRISE = 0X03;
while(1){
case 0:
res_adc = adc_read(0);
portb = ADRESL;
portd = ADRESH;
break;
case 1:
res_adc = adc_read(1);
portb = ADRESL;
portd = ADRESH;
break;
case 2:
res_adc = adc_read(2);
portb = ADRESL;
portd = ADRESH;
break;
default:
res_adc = adc_read(3);
portb = ADRESL;
portd = ADRESH;
break;