编程语言
首页 > 编程语言> > ADC滤波算法之平均法加分割法

ADC滤波算法之平均法加分割法

作者:互联网

//ADC基准电压不稳定,精度要求不高是采用
unsigned char N=0,N2=10,N3=10; unsigned long Value_Fiter_1 unsigned short Value_Fiter_2 unsigned short Value_Fiter_3 unsigned short ADC_Fiter(unsigned short Value) {
//===============求平均=====================/ Value_Fiter_1 += Value; N++; if(N<=N2) { Value_Fiter_2 = Value_Fiter_1/N2; Value_Fiter_1 = 0;
N=0; }
//================分割=====================/ if(Value_Fiter_2>Value_Fiter_3+N3) { Value_Fiter_3=Value_Fiter_2; } else if(Value_Fiter_2<Value_Fiter_3-N3) { Value_Fiter_3=Value_Fiter_2; } return Value_Fiter_3; }

 

标签:short,平均法,滤波,unsigned,Value,ADC,Fiter,N3
来源: https://www.cnblogs.com/ChinaPC/p/12525952.html