uchar Adc_conversion(uchar chn)
{
uchar result;
ADCE = 1; // AD comparator enable
ADS = chn; // Select AD Channel
ADCS = 1; // AD conversion enable
while(!ADIF);
result = ADCRH; //high 8bit
ADCS = 0;
ADIF = 0;
return result;
}
*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。