here are excerpts from that code - even tho i did not need bandwidth i left conversion, sampling, and averaging
as they had been for fast operation in a previous code because i am lazy - you will want to play with them and
perhaps get a tiny bit of additional accuracy.
Code:
#include <ADC.h>
unsigned short int i,j,n;
unsigned int value1,value2;
ADC *adc = new ADC(); // adc object;
int readPin = A10;
int readPin2 = A11;
int main() {
Serial.begin(38400);
delay(500);
pinMode(readPin, INPUT);
pinMode(readPin2, INPUT);
pinMode(A10, INPUT);
pinMode(A11, INPUT);
adc->adc0->setAveraging(1);
adc->adc0->setResolution(12);
adc->adc0->setConversionSpeed(ADC_CONVERSION_SPEED::VERY_HIGH_SPEED);
adc->adc0->setSamplingSpeed(ADC_SAMPLING_SPEED::VERY_HIGH_SPEED);
loop:
value1 = adc->analogRead(readPin);
value2 = adc->analogRead(readPin2);
Serial.println(value1);
Serial.println(value2);
Serial.println(" ");
delay(2000);
goto loop;
}