OK, this will no doubt be an easy one. I'm playing around with the zephyr/samples/boards/nrf/battery example, as I have a need for something similar in my own application. My environment is:
- Visual Studio Code with nRF Connect extension
- nRF Connect V2.0.0
- nRF52-DK
But I'm having issues with getting the ADC measurement actually working.
Following the recommendations outlined here, I set up an overlay file as follows:
/ { zephyr,user { io-channels = <&adc 0>; }; };
Goal here was to have AIN0 (which is connected to P0.02) on my hardware as the ADC input channel, as this aligns with my custom board that this code will ultimately be developed for. However, I'm not seeing any change on the reported mV value despite changes in the actual voltage being applied to P0.02.
I'm guessing my allocation of the ADC channel isn't correct, but I can't find anywhere that clearly explains how this is configured for the nRF Connect environment.
Cheers,
Mike