中级会员
- 积分
- 344
- 威望
- 168
- 贡献
- 114
- 兑换币
- 108
- 注册时间
- 2017-2-27
- 在线时间
- 31 小时
|
u16 uniform_AD1;u16 uniform_AD2;u16 uniform_AD3;u16 uniform_AD4;u16 uniform_AD5;
u16 filter_AD1[15];u16 filter_AD2[15];u16 filter_AD3[15];u16 filter_AD4[15];u16 filter_AD5[15];
void inductance_AD_sample() //给数组装初值
{
int inductance_sample_i;
// for(inductance_sample_i=0;inductance_sample_i<15;inductance_sample_i++)
// {
// filter_AD1[inductance_sample_i]=ad_once(ADC1, AD7a,ADC_16bit);
// filter_AD2[inductance_sample_i]=ad_once(ADC1, AD6a,ADC_16bit);
// filter_AD3[inductance_sample_i]=ad_once(ADC1, AD5a,ADC_16bit);
// filter_AD4[inductance_sample_i]=ad_once(ADC1, AD4a,ADC_16bit);
// filter_AD5[inductance_sample_i]=ad_once(ADC0, AD17,ADC_16bit);
// }
}
void inductance_AD_dispose() //信号处理函数
{
inductance_AD_sample();
// int indutance_dispose_i;
// for(indutance_dispose_i=0;indutance_dispose_i<14;indutance_dispose_i++)
// {
// filter_AD1[indutance_dispose_i]=filter_AD1[indutance_dispose_i+1];
// filter_AD2[indutance_dispose_i]=filter_AD2[indutance_dispose_i+1];
// filter_AD3[indutance_dispose_i]=filter_AD3[indutance_dispose_i+1];
// filter_AD4[indutance_dispose_i]=filter_AD4[indutance_dispose_i+1];
// filter_AD5[indutance_dispose_i]=filter_AD5[indutance_dispose_i+1];
// }
// filter_AD1[14]=ad_once(ADC1, AD7a,ADC_16bit);
// filter_AD2[14]=ad_once(ADC1, AD6a,ADC_16bit);
// filter_AD3[14]=ad_once(ADC1, AD5a,ADC_16bit);
// filter_AD4[14]=ad_once(ADC1, AD4a,ADC_16bit);
// filter_AD5[14]=ad_once(ADC0, AD17,ADC_16bit);
// uniform_AD1=uniform_AD2=uniform_AD3=uniform_AD4=uniform_AD5=0;
// for(indutance_dispose_i=0;indutance_dispose_i<15;indutance_dispose_i++)
// {
// uniform_AD1=(u16)(uniform_AD1+filter_AD1[indutance_dispose_i]);
// uniform_AD2=(u16)(uniform_AD2+filter_AD2[indutance_dispose_i]);
// uniform_AD3=(u16)(uniform_AD3+filter_AD3[indutance_dispose_i]);
// uniform_AD4=(u16)(uniform_AD4+filter_AD4[indutance_dispose_i]);
// uniform_AD5=(u16)(uniform_AD5+filter_AD5[indutance_dispose_i]);
// }
// uniform_AD1=(u16)(uniform_AD1/15);
// uniform_AD2=(u16)(uniform_AD2/15);
// uniform_AD3=(u16)(uniform_AD3/15);
// uniform_AD4=(u16)(uniform_AD4/15);
// uniform_AD5=(u16)(uniform_AD5/15);
}
硬件没有问题,应该是软件出问题了,各位大神求解~~
|
|