#include"delay.h"#include"adc.h"#include"OLED_I2C.h"#include"stdlib.h"#include"math.h"//#include"usart.h"externvu16AD_Value[N][M];//用来存放ADC转换结果,也是DMA的目标地址externvu16After_filter[M];////用来存放求平均值externfloatk;intmain(void){?u16adc1;?//u16adc2;?floattemp,temp1,itemp;delay_init();?LED_Init();?Adc_Init(); MYDMA_Config(DMA1_Channel1,(u32)&ADC1->DR,(u32)&AD_Value,N*M);?ADC_SoftwareStartConvCmd(ADC1,ENABLE);?DMA_Cmd(DMA1_Channel1,ENABLE);//启动DMA通道?NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); TIM1_PWM_Init(1999,1);//PWM频率=72000/(256)/46 I2C_Configuration(); OLED_Init();?OLED_CLS();//清屏?OLED_ShowStr(0,0,"ADC_CH1_VAL:",1);?OLED_ShowStr(0,2,"ADC_CH1_VOL:0.00V",1);?OLED_ShowStr(0,4,"ADC_CH1_RVL:00.00V",1);?OLED_ShowStr(0,6,"ADC_CH1_xxL:0.0",1);?//OLED_ShowStr(0,6,"ADC_CH1_AOL:0.000A",1);?k=1;?while(1)