How to get the values from multi channels using one ADC block
Hi,
I am trying to get two voltages using two channels with one ADC block.
My MUC is STM32F103RB. The followings are configruation of ADC and my program code.

HAL_ADC_Start(&hadc2);
for(;;) {
ret = HAL_ADC_PollForConversion(&hadc2, 100);
if(ret == HAL_OK) {
val = HAL_ADC_GetValue(&hadc2);
}
else {
val = 0;
}
printf("#1: %ld\r\n", val1);
ret = HAL_ADC_PollForConversion(&hadc2, 100);
if(ret == HAL_OK) {
val = HAL_ADC_GetValue(&hadc2);
}
else {
val = 0;
}
printf("#2: %ld\r\n", val2);
}
Since the 3.3V line was connected to #1 and #2 was not connected, I expected the values of #1 to be about 4000 and #2 to be about 2800.
However, the actual result is either the values of # 1 and # 2 appear to be opposite to each other, or they represent the same value.

I'd like to know what I should do.
