I am trying to read Vbat(battery voltage) using ADC in STM32F042 ,the reading always is Zero. Anyone please find the reason for it.The code is as follows..please dont metion the syntax error ..i have copied only the necessary parts
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc){ if(__HAL_ADC_GET_FLAG(hadc,ADC_FLAG_EOC)){ adc_value=HAL_ADC_GetValue(hadc); }}main(){ HAL_ADC_Start_IT(&hadc); while(1) { }}static void MX_ADC_Init(void){ ADC_ChannelConfTypeDef sConfig =...