RAK5205 ADC Reading

Hi All.
I seem to be have a problem reading the ADC input on PB12.

I am initialising the ADC as follows:
External_ADC.pin_num = 2;
External_ADC.dir = RUI_GPIO_PIN_DIR_INPUT;
External_ADC.pull = RUI_GPIO_PIN_NOPULL;
rui_adc_init(&External_ADC);

Readings are taken by :
uint16_t wTempReading;
rui_adc_get(&Bat_level,&wTempReading);
RUI_LOG_PRINTF(“ADC Sample: %d\r\n”,wTempReading);

However, I seem to get readings in the 2200 +/- a few counts range regardless of the voltage applied to pin 26 on J22 (PB12).

Has anyone had any success on reading the ADC from PB12?

Cheers,
Martin

After posting I spotting my mistake. It turns out that I was reading the wrong channel. Got to love cut and paste errors…

Hi . Glad you solve it :wink: We will appreciate if you share your project (if possible) with the community :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.