Hi everyone, I know that this topic has been mentioned before, but there are a lot of doubts and the situation about measuring a battery is still not clear.
1) First of all, I tried to handle an saadc example that is proposed by Nordic Semiconductors. I have printed (%d \n", p_event->data.done.p_buffer[i]), but I got random values wherever I plugged the battery that state I want to check. I tired pins 3 (A0), 4 (A1), 28 (A2), 29 (A3), 30 (A4), 31 (A5).
What I have to change to measure the voltage on pin 3 (A0)?
2) Also, I tried the shared and recommended code on GitHub. In the post was mentioned that it is only needed to change 22th line to point what pin has to be measured. What channel has to be proposed to measure for example pin 3 (A0)?
To check the state of the battery I have used the voltage divided consisted of 0,985 MOhm resistor and 1,97 MOhm resistor. At the output I obtain ~ 2,7 voltage.
Ladies and gentlemen, please give me an advice how I can solve this problem. I have tried many things and I think this post can be helpful also for next generations.
Kind regards from sunny Columbia!