This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF51822 measure input voltage

Hi,

I am trying to use an nrf51822 with a sensor that outputs value between 0-5V. What I am confused about is how to read input voltage on the beacon. I saw some people using ADC, but there was no clear instruction on how exactly to do it. Maybe you could provide clear instructions on how to configure a pin as an input pin correctly, set up the ADC and read the voltage, let's say, every 100ms? This would be very helpful.

Looking forward to hearing from you. Thanks in advance.

Regards, Robert

Parents Reply
  • Alright, thanks for that remark. Still, I am struggling with the thing a bit... In the examples I could not find a place to specify pin number to read, and there was no timer so whenever I called adc_start(); It kept running all the time interrupting everything else. Is there a way to apply a timer correctly and is the function correct at all? I will include my code in an answer. And here is the example devzone.nordicsemi.com/.../

    I just removed the battery part and put my own function to change advertised minor value to adc_result.

Children
No Data
Related