int analogXPin = 14;
int analogYPin = 27;
void setup() {
// initialize serial communication at 115200 bits per second:
Serial.begin(115200);
//set the resolution to 12 bits (0-4096)
analogReadResolution(12);
}
void loop() {
// read the analog / millivolts value for pin 2:
int analogValueX = analogRead(analogXPin);
int analogVoltsX = analogReadMilliVolts(analogXPin);
int analogValueY = analogRead(analogYPin);
int analogVoltsY = analogReadMilliVolts(analogYPin);
// print out the values you read:
Serial.printf("ADC analog valueX = %d, valueY = %d\n",analogValueX,analogValueY);
Serial.printf("ADC millivolts valueX = %d,valueY = %d\n",analogVoltsX,analogVoltsY);
delay(100); // delay in between reads for clear read from serial
}