int analogPin = 12; // potentiometer wiper (middle terminal) connected to analog pin 3
// outside leads to ground and +5V
int val = 0; // variable to store the value read
void setup() {
Serial.begin(9600);
analogReadResolution(16); // setup serial
}
void loop() {
val = analogRead(analogPin); // read the input pin
Serial.println(val);
delay(100); // debug value
}