Author Topic: AnalogInput units  (Read 725 times)

mc-John

  • Global Moderator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: AnalogInput units
« on: February 06, 2017, 06:59:41 pm »
We have the resolution at 14-bit. The system returns the result (NRF_SAADC->RESULT.PRT). Because we return the value in millivolt we multiply that by 3600 and divide that by 2^14.

Code: [Select]
return (result*3600)>>14;


To get the value back you just have to undo this like the code below:

Code: [Select]
result = (millivolt<<14)/3600;