ADC Reference

Quick question: Is there any way to program the ADC reference using the Android SDK? I don't see this mentioned in the documentation.



  • I think I found the answer to my own question. I believe the following line of code will use the internal 1.2V reference:

    gpioModule.routeData().fromAnalogIn((byte) 2, AnalogReadMode.ABS_REFERENCE);
  • What do you mean by "program the ADC reference" ?  If you are trying to read the ADC ratio, then use AnalogReadMode.ADC.
  • edited August 2015
    Sorry for the lack of clarity...what I meant is "tell the ADC to use the internal 1.2V reference instead of a ratio of supply voltage." The line of code above appears to accomplish that.
This discussion has been closed.