/* Program 7-1 Read the analog value of the pin connected to the pontentiometer. * The potentiometer is connected pin A1. * The ADC has 10-bit resolution for AVR and default is 10-bit in Arduino. */ /* Pin A1 is connected to a potentiometer */ const int pot = A1; void setup() { Serial.begin(9600); Serial.println("Potentiometer:"); } void loop() { /* read the voltage from ADC */ int potValue = analogRead(pot); /* write it to the Serial monitor */ Serial.print(" potentiometer value = "); Serial.println(potValue, DEC); delay(100); }