AD采样求平均STM32实现

时间:2023-09-27 20:48:20
 iADC_read(, &u16NTC_1_Sample_Val_ARR[]);

     if( == ui8FirstSampleFlag)
{
for(i=; i<; i++)
{
u16NTC_1_Sample_Val_ARR[i] = u16NTC_1_Sample_Val_ARR[];
}
ui8FirstSampleFlag = ;
} u16NTC_1_Sample_Val_ARR[] = (uint16_t)
((0.1f) * ((float)(u16NTC_1_Sample_Val_ARR[] + u16NTC_1_Sample_Val_ARR[]
+ u16NTC_1_Sample_Val_ARR[] + u16NTC_1_Sample_Val_ARR[]
+ u16NTC_1_Sample_Val_ARR[] + u16NTC_1_Sample_Val_ARR[]
+ u16NTC_1_Sample_Val_ARR[] + u16NTC_1_Sample_Val_ARR[]
+ u16NTC_1_Sample_Val_ARR[] + u16NTC_1_Sample_Val_ARR[]))); for(i=; i<=; i++)
{
u16NTC_1_Sample_Val_ARR[i-] = u16NTC_1_Sample_Val_ARR[i];
}
 uint8_t iADC_read( uint8_t ucAdcChn, uint16_t *u16AdcData)
{
*u16AdcData = (uint16_t)ADC_ConvertedValue[ucAdcChn] ;
return ();
}
 __IO uint16_t ADC_ConvertedValue[ADC_DMA_BUFFER_SIZE]= {};