ADC10CTL1|=INCH_0;
ADC10CTL0|=ADC10SC+ENC; // 开始转换 开转换允许
while(ADC10CTL1&ADC10BUSY!=0);//判断是否转换完毕
result[0]= ADC10MEM;
ADC10CTL0&=~(ADC10SC+ENC); //关转换允许才能选择通道
ADC10CTL1&=~INCH_0; //通道清0
ADC10CTL1|=INCH_3;
ADC10CTL0|=ADC10SC+ENC;
while(ADC10CTL1&ADC10BUSY!=0);
result[1]= ADC10MEM;
ADC10CTL0&=~(ADC10SC+ENC);
ADC10CTL1&=~INCH_3;
ADC10CTL1|=INCH_4;
ADC10CTL0|=ADC10SC+ENC;
while(ADC10CTL1&ADC10BUSY!=0);
result[2]= ADC10MEM;
ADC10CTL0&=~(ADC10SC+ENC);
ADC10CTL1&=~INCH_4; |