一、CubeMX配置
生成工程后
HAL_ADCEx_Calibration_Start(&hadc2 ,ADC_SINGLE_ENDED);
写功能函数。
HAL_ADC_Start (&hadc2 );
HAL_ADC_PollForConversion(&hadc2 ,10);
V_R37 = HAL_ADC_GetValue (&hadc2 ) * 3.3 / 4096;
生成工程后
HAL_ADCEx_Calibration_Start(&hadc2 ,ADC_SINGLE_ENDED);
写功能函数。
HAL_ADC_Start (&hadc2 );
HAL_ADC_PollForConversion(&hadc2 ,10);
V_R37 = HAL_ADC_GetValue (&hadc2 ) * 3.3 / 4096;