void GetADValue(uchar channel) //启动AD转换,得到AD值
{
uchar j;
ADpara.ADvalue = 0;
ADpara.AD_num = 0;
ADC12Init(); //初始化AD模块
SwitchChannel(channel); //通道选择
OpenAD();
while(ADpara.AD_num<9);
ADpara.AD_num = 0;
for(j=1;j<9;j++)
{
ADpara.ADvalue += ADvalue_TEM[j];
}
ADpara.ADvalue >>= 3; //除以8 ,8次的平均值
AD_CurrentValue = ADpara.ADvalue;
CloseAD();
}
小女子初学430!o(∩_∩)o !有关这里面的AD转换几个量不懂! ADpara.ADvalue ,ADpara.AD_num是什么东东啊?他们中间那个.是什么意思?:carnation: 师兄师姐求助啊!
此帖出自
小平头技术问答
一周热门 更多>